SetCustomIcon

Last Revision:
Version 1.1, 2006-08-01
Added Mac OS X 10.4 support to set disk icons. Updated to produce a universal binary. No code changes were required.
(Full Revision History)
Build Requirements:
Xcode
Runtime Requirements:
Mac OS X

SetCustomIcon demonstrates how to programmatically set a custom icon of either a file or folder. A typical example may be to create an icon representation of a photo or picture. This example uses QuickTime's Graphics Importers in two areas. The Graphics Importer is used to draw the source image to the screen from the user panes kEventControlDraw event handler routine. It is also used during the process of converting the image to a PicHandle which is then used in the creation of an IconFamilyHandle. The utility routine SaveCustomIcon() is responsible for saving the IconFamilyHandle data as a resource in the appropriate format and location.