CommandBar_AddAdornments

The CommandBar_AddAdornments function adds the Close button (X) to the command bar. You can also use it to add the Help button (?) and the OK button.

Syntax

BOOL CommandBar_AddAdornments(HWND hwndCB, DWORD dwFlags, DWORD dwReserved);

At a Glance

Header file: Commctrl.h
Platforms: H/PC
Windows CE versions: 1.0 and later

Parameters

hwndCB
The command bar's window handle. This handle is returned when the command bar is created by the CommandBar_Create function.
dwFlags
Optional buttons to be added to the command bar. This parameter can be a combination of the following values, or zero if neither of the optional buttons are needed.
Value Meaning Message
CMDBAR_HELP Help button WM_HELP
CMDBAR_OK OK button WM_COMMAND (with IDOK as the message identifier)

dwReserved
Reserved; must be zero.

Return Values

TRUE if the function succeeds. FALSE if it fails.

Remarks

When a user selects the Close, OK, or Help button, the message associated with that button is placed in the application's message queue.

Do not call the CommandBar_AddAdornments member function until after you have added all the other elements (menus, buttons, combo boxes) to the command bar.

See Also

CommandBar_AddButtons, CommandBar_InsertButton