User Information ResourcesThe 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
Description User name -16096 'STR ' The name of the person who "owns" the computer or is the current user. Use the
GetStringfunction with this resource ID to return the user 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
GetStringfunction 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
Gestaltselector for the computer model is
gestaltMachineModel, and the
Gestaltfunction returns a response value for this selector. You can use
this value as an index into the
'STR#'resource using the
GetIndStringprocedure. You should never use the model of the computer as an indication of what software features or hardware may be available.
responseparameter returned from
The icon for the computer model, such as the Macintosh II or Macintosh IIci. The icons for computers are stored in icon families. The
Gestaltselector for the computer icon is
gestaltMachineIcon. Use the value from the
responsevalue 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
GetStringfunction to return the type of printer.
You should use
GetResource, 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.
Gestaltfunction are documented in Inside Macintosh: Operating System Utilities.