Microsoft KB Archive/125682

{|
 * width="100%"|

HOWTO: Use the Small Icon in Windows

 * }

Q125682

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK), used with:
 * Microsoft Windows 95
 * Microsoft Windows 98
 * the operating system: Microsoft Windows NT 4.0
 * the operating system: Microsoft Windows 2000

-

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

Additional query words:

Keywords : kbIcon kbOSWinNT400 kbOSWin2000 kbResource kbSDKWin32 kbGrpDSUser kbOSWin95 kbOSWin98

Issue type : kbhowto

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch