The command bands control is a special kind of rebar control. It has a fixed band at the top containing a toolbar with a Close (X) button, and optionally, a Help (?) button and an OK button, in the right corner. By default, each band in the command bands control contains a command bar. You can override this, however, if you want a band to contain some other type of child window.
Windows CE command band
The following code example demonstrates how to register a command band and command bar.
INITCOMMONCONTROLSEX icex;
icex.dwSize = sizeof(icex);
icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES;
InitCommonControlsEx(&icex);
HWND hwndCmdBands, hwnd;
REBARBANDINFO arbbi[2];
HIMAGELIST himl = ImageList_Create(16, 16, ILC_COLOR, 2, 0);
hwndCmdBands = CommandBands_Create(g_hinst, hwndParent, BANDS_ID,
RBS_VARHEIGHT | RBS_BANDBORDERS, himl);
arbbi[0].cbSize = sizeof(REBARBANDINFO);
arbbi[0].fMask = RBBIM_ID | RBBIM_STYLE| RBBIM_SIZE | RBBIM_IMAGE;
arbbi[0].fStyle = RBBS_NOGRIPPER ;
arbbi[0].wID = ID_MENUBAND;
arbbi[0].cx = 100;
arbbi[0].iImage = 0;
arbbi[1].cbSize = sizeof(REBARBANDINFO);
arbbi[1].fMask = RBBIM_ID | RBBIM_IMAGE | RBBIM_SIZE;
arbbi[1].wID = ID_BUTTONBAND;
arbbi[1].cx = 125;
arbbi[1].iImage = 1;
CommandBands_AddBands(hwndCmdBands, g_hinst, 2, arbbi);
hwnd = CommandBands_GetCommandBar(hwndCmdBands, 0);
CommandBar_InsertMenubar(hwnd, g_hinst, IDM_MAINMENU, 0);
hwnd = CommandBands_GetCommandBar(hwndCmdBands, 1);
CommandBar_AddBitmap(hwnd, HINST_COMMCTRL, IDB_STD_SMALL_COLOR, 0, 0, 0);
CommandBar_AddButtons(hwnd, sizeof(tbButtons)/sizeof(TBBUTTON), tbButtons);
CommandBands_AddAdornments(hwndCmdBands, g_hinst, CMDBAR_HELP, NULL);
Command bands controls support the custom draw service, which makes it easy to customize the appearance of a command bands control. For information on the custom draw service, see Overview of Controls.