The LoadIcon function loads the specified icon resource from the executable (.EXE) file associated with an application instance. This function has been superseded by the LoadImage function
HICON LoadIcon(
HINSTANCE hInstance, |
// handle of application instance |
LPCTSTR lpIconName |
// icon-name string or icon resource identifier |
); |
To use one of the Windows predefined icons, set the hInstance parameter to NULL and the lpIconName parameter to one of the following values:
Value |
Description |
IDI_APPLICATION |
Default application icon. |
IDI_ASTERISK |
Asterisk (used in informative messages). |
IDI_EXCLAMATION |
Exclamation point (used in warning messages). |
IDI_HAND |
Hand-shaped icon (used in serious warning messages). |
IDI_QUESTION |
Question mark (used in prompting messages). |
IDI_WINLOGO |
Windows logo. |
If the function succeeds, the return value is the handle of the newly loaded icon.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
LoadIcon loads the icon resource only if it has not been loaded; otherwise, it retrieves a handle to the existing resource. The function searches the icon resource for the icon most appropriate for the current display. The icon resource can be a color or monochrome bitmap.
LoadIcon can only load an icon whose size conforms to the SM_CXICON and SM_CYICON system metric values. Use the LoadImage function to load icons of other sizes.
CreateIcon, LoadImage, MAKEINTRESOURCE
See: