1 out of 4 rated this helpful - Rate this topic

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 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Commctrl.h

Library

Comctl32.lib

DLL

Comctl32.dll

 

 

Send comments about this topic to Microsoft

Build date: 10/27/2012

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.