Carbon


RegisterIconRefFromResource

Header: Icons.h Carbon status: Supported

Adds a resource-derived IconRef to the Icon Services registry.

OSErr RegisterIconRefFromResource (
    OSType creator, 
    OSType iconType, 
    const FSSpec *resourceFile, 
    SInt16 resourceID, 
    IconRef *theIconRef
);
creator

The creator code of the icon data you wish to register. You can use your application’s creator code, for example. Lower-case creator codes are reserved for the system.

iconType

The type code of the icon data you wish to register.

resourceFile

A pointer to the file system specification structure for the resource file from which to read the icon data.

resourceID

The resource ID of the icon data to be registered. This value must be non-zero.

You should provide a resource of type 'icns' if possible. If an 'icns' resource is not available, Icon Services uses standard icon suite resources, such as 'ICN#', instead.

theIconRef

On return, a pointer to the desired icon data.

function result

A result code.

DISCUSSION

You can use the RegisterIconRefFromResource function to register icons from 'icns' resources or “classic” custom icon resources ('ics#', 'ICN#', etc.). Icon Services searches 'icns' resources before searching other icon resources.

Calling this function increments the reference count of the IconRef.

Remember to call the function ReleaseIconRef when you're done with an IconRef.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when IconServicesLib 8.5 or later is installed. Exported by CarbonLib 1.0 and later and by IconServicesLib 8.5 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/18/2000)