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.
A version of this page is also available for
4/8/2010

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

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 hiparameter is non-NULL, lpbmpis the address of a null-terminated string that contains the name of the image resource in the himodule.

If hiis NULL, the low-order word of this parameter must be the identifier of an OEM image to load. To create this value, use the MAKEINTRESOURCEmacro with one of the OEM image identifiers defined in Winuser.h. These identifiers have the following prefixes:

  • OBM_ for OEM bitmaps

  • OIC_ for OEM icons

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 Value

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

Remarks

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

Requirements

Header commctrl.h
Library commctrl.lib, Imgctl.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also