Description

Loads an icon, cursor, animated cursor, bitmap or an enhanced metafile from a dll resources or file

Syntax

HANDLE LoadImage( HINSTANCE hInstance, LPCSTR lpszName, UINT uType, int cxDesired, int cyDesired, UINT nLoad )

Parameters

hInstance
lpszName
uType
cxDesired
[inpupt] is the desired width of the image being loaded (in pixels)
cyDesired
[inpupt] is the desired heiht of the image being loaded (in pixels)

Return

If the function succeeds, the return value is the handle of the newly loaded image.

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

Remark

When you are finished using a bitmap, cursor, or icon you loaded without specifying the LR_SHARED flag, you can release its associated memory by calling one of the functions in the following table.

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.