HeaderPane
Main
Hide
Share Link
Print

ItemBitmap

Defines an item's item picture using a bitmap handle.

C

HBITMAP WINAPI SftBox_GetItemBitmap(HWND hwndCtl, LONG indexTC);
BOOL WINAPI SftBox_SetItemBitmap(HWND hwndCtl, LONG indexTC, HBITMAP hBitmap);

C++

HBITMAP CSftBox::GetItemBitmap(LONG indexTC) const;
BOOL CSftBox::SetItemBitmap(LONG indexTC, HBITMAP hBitmap);

Parameters

hwndCtl

The window handle of the combo box control.

indexTC

The zero-based index of the item for which the item picture is to be retrieved or set. Using SetItemBitmap, -1 can be specified to register the size of hBitmap as the item picture size, without assigning the bitmap to an item.

hBitmap

A bitmap handle to be used as item picture. The top, left pixel of the bitmap must contain the image's background color. This color will be replaced by the actual background color when the bitmap is displayed. This parameter may be NULL to remove an item's item picture.

Returns

GetItemBitmap returns the handle of the bitmap used as the requested item's item picture, or NULL if the item doesn't have an item picture which is a bitmap.

SetItemBitmap returns TRUE if the function was successful, otherwise FALSE is returned.

Comments

The GetItemBitmap and SetItemBitmap functions define an item's item picture using a bitmap handle.

These functions are obsolete. GetItemPicture and SetItemPicture should be used instead, which define an item picture using a SFT_PICTURE structure, supporting bitmaps, icons, ImageList images and GDI+ images.

The item picture area doesn't become visible until the item picture size has been registered using SetPictures or SetItemBitmap with an index of -1.

The application retains ownership of the bitmap and cannot delete the bitmap until the combo box control no longer uses it (usually until the combo box control is destroyed or the item picture is changed).

In a combo box control using a virtual data source, SetItemBitmap can only be used to register the picture size, otherwise an error is returned. The ItemPicture member of the SFTBOX_ITEM structure is used instead.

See Also C/C++ API | Categories | Notifications


Last Updated 11/21/2026 - (email)
© 2026 Softel vdm, Inc.