Important: The information in this document is obsolete and should not be used for new development.
PBDTGetIcon
To retrieve an icon definition, use thePBDTGetIcon
function.
FUNCTION PBDTGetIcon (paramBlock: DTPBPtr; async: Boolean): OSErr;
paramBlock
- A pointer to a desktop parameter block.
async
- A Boolean value that specifies asynchronous (
TRUE
) or synchronous (FALSE
) execution.
--> ioCompletion ProcPtr A pointer to a completion routine. \xAE ioResult OSErr The result code of the function. --> ioDTRefNum Integer The desktop database reference number. --> ioTagInfo LongInt Reserved; must be set to 0. --> ioDTBuffer Ptr A pointer to a buffer to hold the icon's data. --> ioDTReqCount LongInt The requested size of the icon's bitmap. \xAE ioDTActCount LongInt The actual size of the icon's bitmap. --> ioIconType SignedByte The icon type. --> ioFileCreator OSType The icon's file creator. --> ioFileType OSType The icon's file type. DESCRIPTION
ThePBDTGetIcon
function returns the bitmap for an icon that represents a file of a given type and creator. (For example, to get the icon for a file of file type'SFWR'
created by the application with a signature of'WAVE'
, specify these two values inioFileType
andioFileCreator
.) You pass a pointer to a buffer for the icon bitmap in theioDTBuffer
field. The bitmap is returned in this buffer. You specify the desktop database inioDTRefNum
, the file creator inioFileCreator
, and the file type inioFileType
. For the icon type inioIconType
, specify a constant from the
following list:The value you supply in
ioDTReqCount
is the size in bytes of the buffer that you've allocated for the icon's bitmap pointed to byioDTBuffer
; this value depends on the icon type. Be sure to allocate enough storage for the icon data; 1024 bytes is the largest amount required for any icon in System 7. You can use constants to indicate the amount of memory you have provided for the icon's data. The following list shows these constants and, for each icon type, shows the amount of bytes you should allocate.The value in
ioDTActCount
reflects the size of the bitmap actually retrieved. IfioDTActCount
is larger thanioDTReqCount
, only the amount of data allowed
byioDTReqCount
is valid.RESULT CODES
noErr 0 No error ioErr -36 I/O error rfNumErr -51 Reference number invalid extFSErr -58 External file system--file system identifier is nonzero afpItemNotFound -5012 Information not found