How To Use the Small Icon in Windows (125682)



The information in this article applies to:

  • Microsoft Platform Software Development Kit (SDK) 1.0, when used with:
    • Microsoft Windows 95
    • Microsoft Windows 98
    • the operating system: Microsoft Windows NT 4.0
    • the operating system: Microsoft Windows 2000

This article was previously published under Q125682

SUMMARY

Under Windows 95, Windows 98, Windows NT 4.0, and Windows 2000, each application is associated with two icons: a small icon (16x16) and a large icon (32x32). The small icon is displayed in the upper-left hand corner of the application and on the taskbar.

MORE INFORMATION

Large and small icons are associated with an application by using the RegisterClassEx() function. This function takes a pointer to a WNDCLASSEX structure. The WNDCLASSEX structure is similar to the WNDCLASS structure except for the addition of the hIconSm parameter, which is used for the handle to the small icon. If no small icon is associated with an application, Windows 95 will use a 16x16 representation of the large icon.

NOTE: RegisterClassEx() is not currently implemented in Windows NT where it returns NULL.

The LoadIcon() function loads the large icon member of an icon resource. To load the small icon, use the new LoadImage() function as follows:
   LoadImage(  hInstance,
               MAKEINTRESOURCE(<icon identifier>),
               IMAGE_ICON,
               16,
               16,
               0);
				
The small icon currently associated with the application will be displayed in the upper-left corner of the application's main window and on the task bar. Both the large and the small icon association can be changed at runtime by using the WM_SETICON message.

By default, the start menu will display the first icon defined in an application's resources. This can be changed through the start menu property sheets.

Explorer displays the first defined icon in an application's resources unless the application adds an entry to the registry under the program information called DefaultIcon or defines an icon handler shell extension for the file type. Refer to the Shell Extension documentation for more information on shell extensions.

Modification Type:MinorLast Reviewed:7/11/2005
Keywords:kbhowto kbIcon kbResource KB125682