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 9 - Desktop Manager / Desktop Manager Reference
Routines / Reading the Desktop Database


You can iteratively generate a list of icon types associated with each file type supported by an application by repeatedly calling the PBDTGetIconInfo function.

FUNCTION PBDTGetIconInfo (paramBlock: DTPBPtr; 
                          async: Boolean): OSErr;
A pointer to a desktop parameter block.
A Boolean value that specifies asynchronous (TRUE) or synchronous (FALSE) execution.
-->ioCompletionProcPtrA pointer to a completion routine.
\xAEioResultOSErrThe result code of the function.
-->ioDTRefNumIntegerThe desktop database reference number.
-->ioIndexIntegerAn index into the icon list.
-->ioTagInfoLongIntReserved; must be set to 0.
\xAEioDTActCountLongIntThe size of the icon's bitmap.
\xAEioIconTypeSignedByteThe icon type.
-->ioFileCreatorOSTypeThe icon's file creator.
\xAEioFileTypeOSTypeThe icon's file type.

The PBDTGetIconInfo function retrieves an icon type and the associated file type supported by a given creator in the database. You use it to identify the set of icons associated with each file type that is supported by a given creator. You specify the creator by placing its signature in ioFileCreator, and you specify the database by placing the desktop database reference number in the ioDTRefNum field. The PBDTGetIconInfo function returns the size of the bitmap in ioDTActCount, the file type in ioFileType, and the icon size and color depth in ioIconType.

The PBDTGetIconInfo function can return in the ioIconType field any of the values listed in the description of the PBDTGetIcon function on page 9-12. Ignore any values returned in ioIconType that are not listed there; they represent special icons and information used only by the Finder.

To step through a list of the icon types and file types supported by an application, make repeated calls to PBDTGetIconInfo, specifying a creator and an index value for ioIndex each call. Set the index to 1 on the first call, and increment it on each subsequent call until ioResult returns afpItemNotFound.

noErr0No error
ioErr-36I/O error
rfNumErr-51Reference number invalid
extFSErr-58External file system--file system identifier is nonzero
afpItemNotFound-5012Information not found
To get a list of file types that an application can natively open, you can use the GetFileTypesThatAppCanNativelyOpen function, as described in the chapter "Translation Manager" of this book.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996