2.1.25.46 LoadIcon


Description

Loads an icon from resource

Syntax

HICON LoadIcon( HINSTANCE hInstance, LPCSTR lpIconName )

Parameters

hInstance
[input]instance handle, use NULL when Loading from file
lpIconName
[input]either resource name or resID translated into a pointer

Return

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

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

Examples

Remark

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.

See Also

DestroyIcon

Header to Include

origin.h

Reference