CFrameWnd::AddAdornments

Call this member function to add the Close button (X) to the command bar. You can also use it to add the Help button (?) and the OK button.

Syntax

BOOL AddAdornments( DWORD dwflags );

At a Glance

Header File Afxwin.h
Platforms
Versions 1.0 and later

Parameters

dwFlags
Optional buttons to be added to the command bar. This parameter can be a combination of the following values, or zero if no additional buttons are needed.
Value Meaning Message
CMDBAR_HELP Help button WM_HELP
CMDBAR_OK OK button WM_COMMAND (with IDOK as the message identifier)

Return Values

TRUE if the function succeeds. FALSE if it fails.

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.

Don't call the CFrameWnd::AddAdornments member function until after you've added all the other elements (menus, buttons, combo boxes) to the command bar.

Note This member function of the CFrameWnd class is unique to Windows CE.

See Also

CFrameWnd Overview, CFrameWnd Member Functions, Frame Windows and Splitter Windows