CRebar::AddAdornments

This method adds the Close button (X) to the command bar. You can also use it to add the Help button (?) and the OK button. This method is unique to MFC for Windows CE.

At a Glance

Header file: Afxext.h
Platforms: Palm-size PC, H/PC Pro
Windows CE versions: 2.10 and later

Syntax

BOOL AddAdornments(DWORD dwFlags = 0);

Parameters

dwFlags
Specifies optional buttons to be added to the command bar. It is zero if only the Close button is needed, or a combination of the following values:
CMDBAR_HELP
Adds a Help button to the command bar. When selected by a user, this button sends a WM_HELP message.
CMDBAR_OK
Adds an OK button to the command bar. When selected by a user, this button sends a WM_COMMAND message with IDOK as the message identifier.

Return Values

TRUE indicates success. FALSE indicates failure.

Remarks

This method creates a minimum of two buttons; a separator which aligns the selected adornment(s) to the right side of the rebar and the selected adornment(s).

When a user selects the Close (X), OK, or Help (?) button, the message associated with that button is placed in the application’s message queue. This method always creates a Close button; the OK button and the Help button are optional.

Do not call the this method until after you have added all the other elements (menus, buttons, combo boxes) to the rebar.