Toolbar Features

Windows CE supports messages that allow you to customize the look and behavior of toolbars and toolbar buttons.

You can create transparent toolbars by specifying the TBSTYLE_FLAT or TBSTYLE_TRANSPARENT styles. If you give a toolbar the TBSTYLE_FLAT style, the toolbar displays its buttons, but the toolbar itself is transparent. If you give a toolbar the TBSTYLE_TRANSPARENT style, the client area shows through the buttons as well as through the underlying toolbar.

You can use image lists to customize the way a toolbar displays buttons in various states. You can set and retrieve image lists for toolbar buttons by using the TB_GETIMAGELIST and TB_SETIMAGELIST messages for buttons in their default unpressed state, and the TB_GETDISABLEDIMAGELIST and TB_SETDISABLEDIMAGELIST messages for buttons in their disabled state. You load images into a toolbar's image list by using the TB_LOADIMAGES message.

Windows CE supports a toolbar button style called a drop-down button. When a user taps a button that has the TBSTYLE_DROPDOWN style, the toolbar sends the TBN_DROPDOWN notification to its parent window. The parent window usually responds by displaying a pop-up menu or list box under the drop-down button.

Note In Windows CE, the TBNOTIFY structure has been renamed NMTOOLBAR to conform to standard naming conventions, but the two structures are identical.

Because toolbars in Windows CE support the custom draw service, you have flexibility to customize a toolbar's appearance. If a toolbar provides this service, it sends the new NM_CUSTOMDRAW notification at specific times during drawing operations. The lParam of the NM_CUSTOMDRAW notification is a pointer to an NMCUSTOMDRAW structure, which contains the information necessary to draw the customized toolbar. For information on the custom draw service, see Overview of Controls.