## 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
[inpupt] instance handle, use NULL when Loading from file
lpszName
[inpupt] when loading from resource, either resource name or resID translated into a pointer when Loading from file, pass file name
uType
[inpupt]type of the picture loading could one of IMAGE_BITMAP,IMAGE_ICON,IMAGE_ENHMETAFILE
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)
[inpupt] Load flags, is one of the LR_ defines above. If loading from File for example use, LR_LOADFROMFILE

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