Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

CToolBarCtrl::AddBitmap

Adds one or more button images to the list of button images stored in the toolbar control.

int AddBitmap(
   int nNumButtons,
   UINT nBitmapID 
);
int AddBitmap(
   int nNumButtons,
   CBitmap* pBitmap 
);

Parameters

nNumButtons
Number of button images in the bitmap.
nBitmapID
Resource identifier of the bitmap that contains the button image or images to add.
pBitmap
Pointer to the CBitmap object that contains the button image or images to add.

Return Value

Zero-based index of the first new image if successful; otherwise – 1.

Remarks

You can use the Windows API CreateMappedBitmap to map colors before adding the bitmap to the toolbar. If you pass a pointer to a CBitMap object, you must ensure that the bitmap is not destroyed until after the toolbar is destroyed.

See Also

CToolBarCtrl Overview | Class Members | Hierarchy Chart | CToolBarCtrl::AddButtons | CToolBarCtrl::InsertButton | CToolBarCtrl::AddString | CToolBarCtrl::AddStrings

Show:
© 2015 Microsoft