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:
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.