Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: More Macintosh Toolbox /
Chapter 1 - Resource Manager / Resource Manager Reference
Data Structure, Resource Types, and Resource IDs


Resource IDs

A resource is identified by its resource type and resource ID (or, optionally, its resource type and resource name). The IDs for resources used by the system software and those used by applications are assigned from separate ranges. By using these ranges correctly, you can avoid resource ID conflicts.

In general, system resources use IDs in the range -32767 through 127, and application resources must use IDs that fall between 128 and 32767. The IDs for some categories
of resources, such as definition procedures and font families, fall in different ranges or
in ranges that are broken down for more specific purposes. This list shows the resource ID ranges used for most resources.
RangeDescription
-32768 through -16385Reserved; do not use. Any application resource whose ID is in this range will not work properly in current versions of system software.
-16384 through -4065Used for system resources owned by other system resources.
-4064 through -4033Reserved for use by control panels. (See the chapter "Control Panels" in this book.)
-4032 through -1 Used for system resources owned by other system resources. The exception is the 'SIZE' resource, whose ID can be -1, 0 (preferred size), or 1 (minimum size).
0 through 127 Used for system resources and any definition procedures in the system software. Applications should not use these resource IDs.
128 through 32767Available for your use. Your application's definition procedures should use IDs in the range 128 through 4095, although other resources may use these IDs as well. Font families for individual script systems have additional restrictions defined in the appendix on international resources in Inside Macintosh: Text.

For a general discussion of font family resource IDs, see Inside Macintosh: Text.

The ID range of definition procedures (which are usually contained in resources such as the 'WDEF' or 'CDEF' resources) is limited to 12 bits (0 through 4095). The system software's own definition procedures, which are located in the System file, have resource IDs from 0 through 127. The IDs of your definition procedures should be in the range 128 through 4095.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996