Important: The information in this document is obsolete and should not be used for new development.
User Information Resources
The following resources in the resource fork of the System file provide the user's name, the computer name, the model of computer, the icon for the computer model, and the current printer type:
Information Resource ID Resource
typeDescription User name -16096 'STR ' The name of the person who "owns" the computer or is the current user. Use the GetString
function with this resource ID to return the user name.Computer
name-16413 'STR ' The name of the computer, which is distinct from the user name and from any internal hard disks that may be present. The default name of the computer is "User name's Macintosh." Use the GetString
function with this resource ID to return the computer name.Computer model -16395 'STR#' The model of the computer, such as Macintosh SE/30 or Macintosh IIci. The Gestalt
selector for the computer model isgestaltMachineModel
, and theGestalt
function returns a response value for this selector. You can use
this value as an index into the'STR#'
resource using theGetIndString
procedure. You should never use the model of the computer as an indication of what software features or hardware may be available.Computer
iconValue of response
parameter returned fromGestalt
'ICN#'
'icl4'
'icl8'
'ics#'
'ics4'
'ics8'The icon for the computer model, such as the Macintosh II or Macintosh IIci. The icons for computers are stored in icon families. The Gestalt
selector for the computer icon isgestaltMachineIcon
. Use the value from theresponse
value for this selector as the resource ID of the icon resource you want. (For more information about icon families, see the chapter "Finder Interface" in Inside Macintosh: Macintosh Toolbox Essentials.)Printer type -8192 'STR ' The type of printer to which the computer sends documents, such as a LaserWriter printer. There is no method for retrieving the name of the printer. Use the GetString
function to return the type of printer.You should use
GetString
, notGetResource
, to get the string for the user name or the computer name. Once you have the string, you should not release it, dispose of it, or make it purgeable. You will find that the resource was already loaded when you asked for it, so it should remain loaded when you are finished. Do not change the contents of either of these strings or mark them as changed. System 6 and earlier versions of system software do not necessarily have the computer name resource, and for this reason you should provide error checking as appropriate.The
GetString
function,GetIndString
procedure, andGestalt
function are documented in Inside Macintosh: Operating System Utilities.