5.2 Using Built-In Icons

Windows provides several built-in icons, which you can use in your applications, and which Windows uses in message boxes to indicate notes, cautions, warnings, and errors.

To use a built-in icon, you must first load it, using the LoadIcon function to retrieve the icon handle. The first argument to the function must be NULL, indicating that you are requesting a built-in icon. The second argument identifies the icon you want. For example, the following statement loads the built-in exclamation mark icon:

hHandIcon = LoadIcon(NULL, IDI_EXCLAMATION);

Once it has loaded a built-in icon, your application can use the icon—for example, by specifying it as the class icon for a particular window class, or by including the icon in a message box. For more information, see Section 5.4, “Specifying a Class Icon,” and Section 5.5, “Displaying Your Own Icons.”