ImageList_Add function

Adds an image or images to an image list.

Syntax


int ImageList_Add(
  _In_      HIMAGELIST himl,
  _In_      HBITMAP hbmImage,
  _In_opt_  HBITMAP hbmMask
);

Parameters

himl [in]

Type: HIMAGELIST

A handle to the image list.

hbmImage [in]

Type: HBITMAP

A handle to the bitmap that contains the image or images. The number of images is inferred from the width of the bitmap.

hbmMask [in, optional]

Type: HBITMAP

A handle to the bitmap that contains the mask. If no mask is used with the image list, this parameter is ignored. This parameter can be NULL.

Return value

Type: int

Returns the index of the first new image if successful, or -1 otherwise.

Remarks

The ImageList_Add function copies the bitmap to an internal data structure. Be sure to use the DeleteObject function to delete hbmImage and hbmMask after the function returns.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Commctrl.h

Library

Comctl32.lib

DLL

Comctl32.dll

 

 

Community Additions

ADD
Show:
© 2015 Microsoft