SetupDiLoadClassIcon

BOOLEAN
SetupDiLoadClassIcon(
IN LPGUID ClassGuid,
OUT HICON *LargeIcon,    /* optional */
OUT LPINT MiniIconIndex    /* optional */
);

SetupDiLoadClassIcon loads both the large and mini-icon for the specified class.

Parameters

ClassGuid

Supplies the GUID of the class for which the icon(s) should be loaded.

LargeIcon

Supplies a pointer to a variable to receive a handle for the loaded large icon for the specified class. If this parameter is not specified, the large icon is not loaded.

MiniIconIndex

Supplies a pointer to a variable to receive the index of the mini-icon for the specified class. The mini-icon is stored in the device installer's mini-icon cache.

Return Value

The function returns TRUE if it is successful. Otherwise it returns FALSE and the logged error can be retrieved by a call to GetLastError.

Comments

The icons of the class are either predefined and loaded from the device installer’s internal cache, or they are loaded directly from the class installer’s executable. This function querys the registry value ICON in the specified class’ section. If the ICON value is specified, it indicates which mini-icon to load.

If the ICON value is negative, the absolute value represents a predefined icon in the class’ registry. See SetupDiDrawMiniIcon for a list of the predefined mini-icons.

If the ICON value is positive, it represents an icon in the class installer’s executable that will be extracted. The value 1 is reserved. This function also uses the INSTALLER32 registry value and then the ENUMPROPPAGES32 registry value to determine which executable to extract the icon(s) from.

See Also

SetupDiDrawMiniIcon, SetupDiGetClassBitmapIndex