This function adds one or more images to the list of button images available for use in the command bar.
At a Glance
Header file: | Commctrl.h |
Windows CE versions: | 1.0 and later |
Syntax
int CommandBar_AddBitmap(HWND hwndCB, HINSTANCE hInst,
int idBitmap, int iNumImages, int iImageWidth, int iImageHeight);
Parameters
hwndCB
Handle to the command bar’s window. This handle is returned by the CommandBar_Create function when the command bar is created.
hInst
Handle to an instance of the executable module that contains the bitmap resource.
idBitmap
Identifier of the bitmap resource that contains the button images. If you specify HINST_COMMCTRL in the hInst parameter, you can use system-defined button bitmaps by specifying one of the following values.
Value | Description |
IDB_STD_SMALL_COLOR | Adds small, color standard bitmaps. |
IDB_VIEW_SMALL_COLOR | Adds small, color view bitmaps. |
iNumImages
Integer that specifies the number of button images in the bitmap. This can be zero if the bitmap being added is one of the system defined bitmaps—standard or view.
iImageWidth
Integer that specifies the width, in pixels, of the image. Set this parameter to 16.
iImageHeight
Integer that specifies the height, in pixels, of the image. Set this parameter to 16.
Return Values
The index of the first new image indicates success. A value of –1 indicates failure.
Remarks
Each button image should be 16x16 pixels in size.
The following values can be used as indexes to the standard and view 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 | |
VIEW_DETAILS | VIEW_SORTDATE |
VIEW_LARGEICONS | VIEW_SORTNAME |
VIEW_LIST | VIEW_SORTSIZE |
VIEW_SMALLICONS | VIEW_SORTTYPE |
Windows CE version 1.0 only supports 2 bits per pixel (2bp) gray scale, so the bitmaps is not displayed in color.
See Also