ImageList_LoadImage

This function creates an image list from the specified bitmap or icon resource.

At a Glance

Header file: Commctrl.h
Windows CE versions: 1.0 and later

Syntax

HIMAGELIST WINAPI ImageList_LoadImage(HINSTANCE hi, LPCSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType,
UINT
uFlags);

Parameters

hi

[in] Handle to the instance of an application or DLL that contains an image.

lpbmp

[in] Long pointer to the image to load.

If the uFlags parameter includes LR_LOADFROMFILE, lpbmp is the address of a null-terminated string that names the file containing the image to load.

If the hi parameter is non-NULL and LR_LOADFROMFILE is not specified, lpbmp is the address of a null-terminated string that contains the name of the image resource in the hi module.

If hi is NULL and LR_LOADFROMFILE is not specified, the low-order word of this parameter must be the identifier of an OEM image to load. To create this value, use the MAKEINTRESOURCE macro with one of the OEM image identifiers defined in Winuser.h. These identifiers have the following prefixes:

cx

[in] Width of each image. The height of each image and the initial number of images are inferred by the dimensions of the specified resource.

cGrow

[in] Number of images by which the image list can grow when the system needs to make room for new images. This parameter represents the number of new images that the resized image list can contain.

crMask

[in] Color used to generate a mask. Each pixel of this color in the specified bitmap or icon is changed to black, and the corresponding bit in the mask is set to 1. If this parameter is the CLR_NONE value, no mask is generated. If this parameter is the CLR_DEFAULT value, the color of the pixel at the upper-left corner of the image is treated as the mask color.

uType

[in] Flag that specifies the type of image to load. This parameter can be one of the following values:

Value Description
IMAGE_BITMAP Loads a bitmap.
IMAGE_ICON Loads an icon.

uFlags

[in] Unsupported; set to 0.

Return Values

The handle to the image list indicates success. NULL indicates failure.

Remarks

You can only use this function with icons, not cursors.

See Also

ImageList_LoadBitmap