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 an icon, cursor, or bitmap.
HANDLE LoadImage( HINSTANCE hinst , | LPCTSTR lpszName , UINT uType , int cxDesired , int cyDesired , UINT fuLoad );
Parameters
If hinstis NULL and LR_LOADFROMFILE is not specified, the low-order word of this parameter must be the identifier of the OEM image to load. The OEM image identifiers are defined in Winuser.h and have the following prefixes:
Prefix | Description |
---|---|
OBM_ | OEM bitmaps |
OIC_ | OEM icons |
OCR_ | OEM cursors |
If the fuLoadparameter includes the LR_LOADFROMFILE value, lpszNameis the name of the file that contains the image.
Value | Description |
---|---|
IMAGE_BITMAP | Loads a bitmap. |
IMAGE_CURSOR | Loads a cursor. |
IMAGE_ICON | Loads an icon. |
Windows CE behaves as though the LR_DEFAULTCOLOR and LR_DEFAULTSIZE values are set. LR_DEFAULTCOLOR means "not monochrome." LR_DEFAULTSIZE means that the system uses the width or height specified by the system metric values for cursors or icons if the cxDesiredor cyDesiredvalues are set to zero. If the resource contains multiple images, the function uses the size of the first image.
Return Values
The handle of the newly loaded image indicates success. NULL indicates failure. To get extended error information, call GetLastError.
Remarks
When you are finished using a bitmap, cursor, or icon you loaded, you can release its associated memory by calling one of the functions in the following table.
Resource | Release function |
---|---|
Bitmap | DeleteObject |
Cursor | DestroyCursor |
Icon | DestroyIcon |
The system automatically deletes these resources when the process that created them terminates, however, calling the appropriate function saves memory and decreases the size of the process's working set.
If you are targeting a platform that does not support mouse cursors, you cannot specify the SM_CXCURSOR and SM_CYCURSOR values in the cxDesiredand cyDesiredparameters, and you cannot specify IMAGE_CURSOR for the uTypeparameter.
Requirements
Runs on | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 1.0 and later | Winuser.h | Loadimg.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
DeleteObject, DestroyCursor, DestroyIcon, GetLastError, GetSystemMetrics, LoadBitmap, LoadIcon