Using Command Bands

Windows CE supports the following functions for creating and manipulating command bands controls.

Use the CommandBands_AddAdornments function to add a band with the Close (X) button, the Help (?) button, and the OK button. This band will always have a Close button. The OK button and the Help button are optional.

Use the CommandBands_AddBands function to add one or more bands to the control. By default, each band has a command bar as its child window.

Use the CommandBands_Create function to create a command bands control.

You can retrieve a command bar from a band in a command bands control by using the CommandBands_GetCommandBar function. Pass it the zero-based index of the band that contains the command bar you want to retrieve.

Unlike scroll bars and status bars, the command bar is part of the client area of your application. To determine the useable portion of the application window, use the CommandBands_Height function to retrieve the command bar's height in pixels and subtract the height of the command bar from the size of the client rectangle, which you obtain by calling GetClientRect.

Use the CommandBands_IsVisible function to determine whether a command bands control is visible.

Use the CommandBands_GetRestoreInformation function to retrieve information about the bands in a command band control, before you close the application window, so you can save the information in the registry. The next time the application is opened, you can use this information to restore the command bands control to its previous state.

Although you should always have a command bar or a command bands control in a Windows CE-based application that has a graphical user interface, you can provide users with the option to hide the command bands control, as long as it can be retrieved. Use the CommandBands_Show function show or hide the command bands control.

A command band is a rebar control and a toolbar control and can be manipulated using the rebar and toolbar messages.