CToolBarCtrl::AddBitmap

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

返回值:
如果成功则返回第一个新图像的从零开始的索引;否则返回-1。

参数:
nNumButtons位图中的按钮图像的数目。
nBitmapID包含按钮图像或要增加图像的位图的资源标识符。
pBitmap指向包含按钮图像或要增加图像的CBitmap对象的指针。

说明:
此成员函数用来将一个或多个按钮图像添加到保存在该工具条控件中的按钮图像列表中。在向工具条添加位图之前,你可以使用Windows APICreateMappedBitmap来映射颜色。
如果你传递的是一个指向CBitMap对象的指针,则你必须确保直到工具条被销毁的时候该位图才会被销毁。

请参阅:
CToolBarCtrl::AddButtons, CToolBarCtrl::InsertButton, CToolBarCtrl::AddString, CToolBarCtrl::AddStrings