Microsoft Windows CE 3.0  

LoadIcon

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

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

HICON
LoadIcon( HINSTANCE
hInstance
, LPCTSTR
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] Long pointer to a null-terminated string that contains the name of the icon resource to be loaded. Alternatively, this parameter can contain the resource identifier in the low-order word and zero in the high-order word. Use the MAKEINTRESOURCEmacro to create this value.

Return Values

A handle to the newly loaded icon indicates success. NULL indicates failure. To get extended error information, call GetLastError.

Remarks

LoadIconloads 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.

LoadIconcan only load an icon whose size conforms to the SM_CXICON and SM_CYICON system metric values. Use the LoadImagefunction to load icons of other sizes.

In Windows CE version 1.0, the icon must be a two bit per pixel (.ic2) icon or a monochrome icon.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winuser.h   Icon.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

GetLastError, LoadImage, MAKEINTRESOURCE