Defines an item's label picture using a bitmap handle.
C
HBITMAP WINAPI SftBox_GetItemLabel(HWND hwndCtl, LONG index); BOOL WINAPI SftBox_SetItemLabel(HWND hwndCtl, LONG indexTC, HBITMAP hBitmap);
C++
HBITMAP CSftBox::GetItemLabel(LONG index) const; BOOL CSftBox::SetItemLabel(LONG indexTC, HBITMAP hBitmap);
hwndCtl
The window handle of the combo box control.
index, indexTC
The zero-based index of the item for which the label picture is to be retrieved or set. Using SetItemLabel, this parameter may be -1 to register the label picture size and make the label picture area visible.
hBitmap
A bitmap handle to use as the label picture for the specified item. The top, left pixel of the bitmap must contain the image's background color. This color will be replaced by the actual window background color when the bitmap is displayed. If indexTC is -1, this bitmap is only used to determine the size of all label pictures. This parameter may be NULL to remove an item's label picture or to stop displaying label pictures for all items (set indexTC to -1).
GetItemLabel returns the bitmap handle used to draw the requested item's label picture, or NULL if the item doesn't have a label picture defined using a bitmap handle.
SetItemLabel returns TRUE if the function was successful, otherwise FALSE is returned.
The GetItemLabel and SetItemLabel functions define an item's label picture using a bitmap handle.
GetItemLabel and SetItemLabel can be used to define a label picture using a bitmap handle only. The GetItemLabelPicture and SetItemLabelPicture functions should be used instead. They support bitmaps, icons and ImageList images and offer otherwise identical services. Please see SetItemLabelPicture for more information about label pictures.
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 label picture is changed).
In a combo box using a virtual data source, SetItemLabel can only be used to register the label picture size, otherwise an error is returned. The LabelPicture member of the SFTBOX_ITEM structure is used instead.
See Also C/C++ API | Categories | Notifications