CFrameWnd::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.

At a Glance

Header file: Afxwin.h
Platforms: H/PC 2.0, Palm-size PC, H/PC Pro
Windows CE versions: 1.0 and later

Syntax

BOOL AddAdornments( DWORD dwflags );

Parameters

dwFlags
Specifies the optional buttons to be added to the command bar. It is zero if no additional buttons are needed, or a combination of the following values:
Value Description Message
CMDBAR_HELP Help button WM_HELP
CMDBAR_OK OK button WM_COMMAND (with IDOK as the message identifier)

Return Values

TRUE indicates success. FALSE indicates failure.

Remarks

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.

Every command bar has to have a Close button. The OK button and the Help button are optional.

Do not call the CFrameWnd::AddAdornments method until after you add all the other elements (menus, buttons, combo boxes) to the command bar.

This method of the CFrameWnd class is unique to Windows CE.