Icon Display

You can retrieve the image for an icon by using the GetIconInfo function, and can draw it by using the DrawIconEx function. To draw the default image for a icon, specify the DI_COMPAT flag in the call to DrawIconEx. If you do not specify the DI_COMPAT flag, DrawIconEx draws the icon using the image that the user specified.

When the system displays an icon, it must extract the appropriate icon image from the .EXE or .DLL file. The system uses the following steps to select the icon image:

  1. Select the RT_GROUP_ICON resource. If more than one such resource exists, Windows NT uses the first resource listed in the resource script, while Windows 95 chooses the first resource listed in alphabetical order.
  2. Select the appropriate RT_ICON image from the RT_GROUP_ICON resource. If more than one image exists, the system uses the following criteria to choose an image:

Note  The system treats all color depths of 8 or more bpp as equal. Therefore, there is no advantage of including a 16x16 256 color image and a 16x16 16 color image in the same resource  — the system will simply choose the first one it encounters. When the display is in 8 bpp mode, the system will choose a 16 color icon over a 256 color icon, and will display all icons using the system default palette.