Help Center

CToolbar.AddBitmapmethod

Adds one or more images to the list of button images available for a toolbar.

WindowsmethodCToolbar.incdocumented

Syntax

FUNCTION AddBitmap (BYVAL hToolbar AS HWND, BYVAL nButtons AS DWORD, BYVAL ptabm AS TBADDBITMAP PTR) AS LONG
FUNCTION AddBitmap (BYVAL hToolbar AS HWND, BYVAL nButtons AS DWORD, BYREF tabm AS TBADDBITMAP) AS LONG

Parameters

NameDescription
hToolbarHandle to the toolbar control.
nButtonsNumber of button images in the bitmap. If ptabm specifies a system-defined bitmap, this parameter is ignored.
ptabmPointer to a TBADDBITMAP structure that contains the identifier of a bitmap resource and the handle to the module instance with the executable file that contains the bitmap resource.
tabmA TBADDBITMAP structure that contains the identifier of a bitmap resource and the handle to the module instance with the executable file that contains the bitmap resource.

Return value

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

Description

Adds one or more images to the list of button images available for a toolbar.

Remarks

If the toolbar was created using the CreateWindowExW function, you must send the TB_BUTTONSTRUCTSIZE message to the toolbar before sending TB_ADDBITMAP.

Reference

  • Include file CToolbar.inc
  • Defined in AfxNova/CToolbar.inc:207
  • Documented in Windows/WIndows Controls/CToolbar Class.md
  • Topic: CToolbar Class