Skip to content

Latest commit

 

History

History
58 lines (38 loc) · 1.53 KB

File metadata and controls

58 lines (38 loc) · 1.53 KB

Home

Function name : LoadIcon

Group: Icon - Library: user32


Loads the specified icon resource from the executable (.exe) file associated with an application instance.


Code examples:

Drawing standard Windows icons
How to view icons stored in executable files (Icon Viewer)

Declaration:

HICON LoadIcon(
  HINSTANCE hInstance, // handle to application instance
  LPCTSTR lpIconName   // name string or resource identifier
);  

FoxPro declaration:

DECLARE INTEGER LoadIcon IN user32;
	INTEGER hInstance,;
	INTEGER lpIconName  

Parameters:

hInstance [in] Handle to an instance of the module whose executable file contains the icon to be loaded. This parameter must be NULL when a standard icon is being loaded.

lpIconName [in] Pointer to a null-terminated string that contains the name of the icon resource to be loaded.


Return value:

If the function succeeds, the return value is a handle to the newly loaded icon. If the function fails, the return value is NULL.


Comments:

This function has been superseded by the LoadImage function.

Do not use DestroyIcon() to release created handle. A shared icon (this is the one) is valid as long as the module from which it was loaded remains in memory. Same for LoadImage and CopyImage.