5.7 Sample Application: Icon

This sample application shows how to incorporate an icon into your application—in particular, how to do the following:

Use a custom icon as the class icon.

Use an icon in the About dialog box.

To create the Icon application, make the following modifications to the Generic application:

1.Add an ICON statement to the resource-definition file.

2.Add an ICON control statement to the DIALOG statement in the resource-definition file.

3.Load the custom icon and use it to set the class icon in the initialization function.

4.Modify the makefile to cause Microsoft Windows Resource Compiler (RC) to add the icon to the application's executable file.

5.Compile and link the application.

This sample assumes that you have created an icon by using Image Editor and have saved the icon in a file named MYICON.ICO.