CFrameWnd::InsertButtons

Call this member function to add one or more button images to a command bar's button list and insert the buttons into the command bar.

Syntax

BOOL InsertButtons ( LPTBUTTON lpButtons, UINT wNButtons, int nToolbarBitmapID=-1, int nNImages=0 );

At a Glance

Header File Afxwin.h
Platforms
Versions 1.0 and later

Parameters

lpButtons
A pointer to an array of TBBUTTON structures that contains information about the buttons to add to the command bar. There must be the same number of elements in the array as specified by wNButtons.
wNButtons
Number of buttons to add to the command bar.
nToolbarBitmapID
Identifier of the bitmap resource that contains the button images. You can also use the system-defined button bitmaps by specifying one of the following values.
IDB_STD_SMALL_COLOR
Adds small, color standard bitmaps.
IDB_VIEW_SMALL_COLOR
Adds small, color view bitmaps.
nNImages
Number of button images in the bitmap.

Return Value

TRUE if the function succeeds. FALSE if it fails.

Remarks

If the buttons have already been added to the command bar's button list, you can omit the nToolbarBitmapID and nNImages parameters.

Each button image should be 16×16 pixels in size.

If you specify the IDB_STD_SMALL_COLOR in the nToolbarBitmapID parameter, you can use the following values as indexes to the system-defined bitmaps.

STD_COPY STD_PROPERTIES
STD_CUT STD_REDOW
STD_DELETE STD_REPLACE
STD_FIND STD_PASTE
STD_FILENEW STD_PRINT
STD_FILEOPEN STD_PRINTPRE
STD_FILESAVE STD_UNDO
STD_HELP

If you specify the IDB_VIEW_SMALL_COLOR in the nToolbarBitmapID parameter, you can use the following values as indexes to the system-defined bitmaps.

VIEW_DETAILS VIEW_SORTDATE
VIEW_LARGEICONS VIEW_SORTNAME
VIEW_LIST VIEW_SORTSIZE
VIEW_SMALLICONS VIEW_SORTTYPE

Windows CE 1.0 only supports 2 bits per pixel (2bp) gray scale, so the bitmaps won't be displayed in color on Windows CE 1.0 platforms.

CFrameWnd::InsertButtons inserts the specified buttons at the end of the command bar, to the right of any existing elements. If you want to insert a button at a particular index in the command bar, use the global Function, CommandBar_InsertButton. Pass the CFrameWnd::m_hCommandBar data member as the hwndCB parameter to this function.

Note This member function of the CFrameWnd class is unique to Windows CE.

See Also

CFrameWnd Overview, CFrameWnd Member Functions, Frame Windows and Splitter Windows, CFrameWnd::AddBitmap, CommandBar_InsertButton