5.3.3 Loading an Icon Resource

Once you have created an icon file and defined the icon resource in the .RC file, your application can load the icon from its resources by using the LoadIcon function. This function takes the application's instance handle and the icon's name and returns a handle to the icon. The following example loads MyIcon and stores its handle in the variable hMyIcon.

hMyIcon = LoadIcon(hinst, "MyIcon");

After loading the icon, the application can display it.