CMFCMenuBar Class

A menu bar that implements docking. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

Syntax

class CMFCMenuBar : public CMFCToolbar

Members

Public Methods

Name Description
CMFCMenuBar::AdjustLocations (Overrides CMFCToolBar::AdjustLocations.)
CMFCMenuBar::AllowChangeTextLabels Specifies whether text labels can be shown under images on the toolbar buttons. (Overrides CMFCToolBar::AllowChangeTextLabels.)
CMFCMenuBar::AllowShowOnPaneMenu (Overrides CPane::AllowShowOnPaneMenu.)
CMFCMenuBar::CalcFixedLayout Calculates the horizontal size of the toolbar. (Overrides CMFCToolBar::CalcFixedLayout.)
CMFCMenuBar::CalcLayout (Overrides CMFCToolBar::CalcLayout.)
CMFCMenuBar::CalcMaxButtonHeight Calculates the maximum height of buttons in the toolbar. (Overrides CMFCToolBar::CalcMaxButtonHeight.)
CMFCMenuBar::CanBeClosed Specifies whether a user can close the toolbar. (Overrides CMFCToolBar::CanBeClosed.)
CMFCMenuBar::CanBeRestored Determines whether the system can restore a toolbar to its original state after customization. (Overrides CMFCToolBar::CanBeRestored.)
CMFCMenuBar::Create Creates a menu control and attaches it to a CMFCMenuBar object.
CMFCMenuBar::CreateEx Creates a CMFCMenuBar object with additional style options.
CMFCMenuBar::CreateFromMenu Initializes a CMFCMenuBar object. Accepts a HMENU parameter that acts as a template for a populated CMFCMenuBar.
CMFCMenuBar::EnableHelpCombobox Enables a Help combo box that is located on the right side of the menu bar.
CMFCMenuBar::EnableMenuShadows Specifies whether to display shadows for pop-up menus.
CMFCMenuBar::GetAvailableExpandSize (Overrides CPane::GetAvailableExpandSize.)
CMFCMenuBar::GetColumnWidth Returns the width of the toolbar buttons. (Overrides CMFCToolBar::GetColumnWidth.)
CMFCMenuBar::GetDefaultMenu Returns a handle to the original menu in the resource file.
CMFCMenuBar::GetDefaultMenuResId Returns the resource identifier for the original menu in the resource file.
CMFCMenuBar::GetFloatPopupDirection
CMFCMenuBar::GetForceDownArrows
CMFCMenuBar::GetHelpCombobox Returns a pointer to the Help combo box.
CMFCMenuBar::GetHMenu Returns the handle to the menu that is attached to the CMFCMenuBar object.
CMFCMenuBar::GetMenuFont Returns the current global font for menu objects.
CMFCMenuBar::GetMenuItem Returns the toolbar button associated with the provided item index.
CMFCMenuBar::GetRowHeight Returns the height of toolbar buttons. (Overrides CMFCToolBar::GetRowHeight.)
CMFCMenuBar::GetSystemButton
CMFCMenuBar::GetSystemButtonsCount
CMFCMenuBar::GetSystemMenu
CMFCMenuBar::HighlightDisabledItems Indicates whether disabled menu items are highlighted.
CMFCMenuBar::IsButtonExtraSizeAvailable Determines whether the toolbar can display buttons that have extended borders. (Overrides CMFCToolBar::IsButtonExtraSizeAvailable.)
CMFCMenuBar::IsHighlightDisabledItems Indicates whether disabled items are highlighted.
CMFCMenuBar::IsMenuShadows Indicates whether shadows are drawn for pop-up menus.
CMFCMenuBar::IsRecentlyUsedMenus Indicates whether recently used menu commands are displayed on the menu bar.
CMFCMenuBar::IsShowAllCommands Indicates whether pop-up menus display all commands.
CMFCMenuBar::IsShowAllCommandsDelay Indicates whether menus display all the commands after a short delay.
CMFCMenuBar::LoadState Loads the state of the CMFCMenuBar object from the registry.
CMFCMenuBar::OnChangeHot Called by the framework when a user selects a button on the toolbar. (Overrides CMFCToolBar::OnChangeHot.)
CMFCMenuBar::OnDefaultMenuLoaded Called by the framework when a frame window loads the default menu from the resource file.
CMFCMenuBar::OnSendCommand (Overrides CMFCToolBar::OnSendCommand.)
CMFCMenuBar::OnSetDefaultButtonText Called by the framework when a menu is in customization mode and the user changes a menu item's text.
CMFCMenuBar::OnToolHitTest (Overrides CMFCToolBar::OnToolHitTest.)
CMFCMenuBar::PreTranslateMessage (Overrides CMFCToolBar::PreTranslateMessage.)
CMFCMenuBar::RestoreOriginalstate Called by the framework when a menu is in customization mode and the user selects Reset for a menu bar.
CMFCMenuBar::SaveState Saves the state of the CMFCMenuBar object to the registry.
CMFCMenuBar::SetDefaultMenuResId Sets the original menu in the resource file.
CMFCMenuBar::SetForceDownArrows
CMFCMenuBar::SetMaximizeMode Called by the framework when an MDI child window changes its display mode. If the MDI child window is newly maximized or is no longer maximized, this method updates the menu bar.
CMFCMenuBar::SetMenuButtonRTC Sets the runtime class information that is generated when the user dynamically creates menu buttons.
CMFCMenuBar::SetMenuFont Sets the font for all menus in the application.
CMFCMenuBar::SetRecentlyUsedMenus Specifies whether a menu bar displays recently used menu commands.
CMFCMenuBar::SetShowAllCommands Specifies whether the menu bar shows all commands.

Remarks

The CMFCMenuBar class is a menu bar that implements docking functionality. It resembles a toolbar, although it cannot be closed - it is always displayed.

CMFCMenuBar supports the option of displaying recently used menu item objects. If this option is enabled, the CMFCMenuBar displays only a subset of the available commands on first viewing. Thereafter, recently used commands are displayed together with the original subset of commands. In addition, the user can always expand the menu to view all available commands. Thus, each available command is configured to display constantly, or to display only if it has been recently selected.

To use a CMFCMenuBar object, embed it in the main window frame object. When processing the WM_CREATE message, call CMFCMenuBar::Create or CMFCMenuBar::CreateEx. Regardless of which create function you use, pass in a pointer to the main frame window. Then enable docking by calling CFrameWndEx::EnableDocking. Dock this menu by calling CFrameWndEx::DockPane.

Example

The following example demonstrates how to use various methods in the CMFCMenuBar class. The example shows how to set the style of the pane, enable the customize button, enable a Help box, enable shadows for pop-up menus, and update the menu bar. This code snippet is part of the IE Demo sample.

CMFCMenuBar m_wndMenuBar;
m_wndMenuBar.SetPaneStyle(m_wndMenuBar.GetPaneStyle() | CBRS_SIZE_DYNAMIC);
m_wndMenuBar.EnableCustomizeButton(TRUE, -1, _T(""));
// first parameter is the command ID for the button of the Help combo box
// third parameter is the width of the button for the combo box in pixels.
m_wndMenuBar.EnableHelpCombobox(1, _T("enter text here"), 30);
m_wndMenuBar.EnableMenuShadows();
m_wndMenuBar.SetMaximizeMode(true);

Inheritance Hierarchy

CObject

CCmdTarget

CWnd

CBasePane

CPane

CMFCBaseToolBar

CMFCToolBar

CMFCMenuBar

Requirements

Header: afxmenubar.h

CMFCMenuBar::AdjustLocations

Adjusts the positions of the menu items on the menu bar.

virtual void AdjustLocations();

Remarks

CMFCMenuBar::AllowChangeTextLabels

Determines whether text labels are allowed under images in the menu bar.

virtual BOOL AllowChangeTextLabels() const;

Return Value

Returns TRUE if the user can choose to show text labels under images.

Remarks

CMFCMenuBar::AllowShowOnPaneMenu

virtual BOOL AllowShowOnPaneMenu() const;

Return Value

Remarks

CMFCMenuBar::CalcFixedLayout

virtual CSize CalcFixedLayout(
    BOOL bStretch,
    BOOL bHorz);

Parameters

[in] bStretch

[in] bHorz

Return Value

Remarks

CMFCMenuBar::CalcLayout

virtual CSize CalcLayout(
    DWORD dwMode,
    int nLength = -1);

Parameters

[in] dwMode

[in] nLength

Return Value

Remarks

CMFCMenuBar::CalcMaxButtonHeight

virtual int CalcMaxButtonHeight();

Return Value

Remarks

CMFCMenuBar::CanBeClosed

virtual BOOL CanBeClosed() const;

Return Value

Remarks

CMFCMenuBar::CanBeRestored

virtual BOOL CanBeRestored() const;

Return Value

Remarks

CMFCMenuBar::Create

Creates a menu control and attaches it to a CMFCMenuBar object.

virtual BOOL Create(
    CWnd* pParentWnd,
    DWORD dwStyle = AFX_DEFAULT_TOOLBAR_STYLE,
    UINT nID = AFX_IDW_MENUBAR);

Parameters

pParentWnd
[in] Pointer to the parent window for the new CMFCMenuBar object.

dwStyle
[in] The style of the new menu bar.

nID
[in] The ID for the child window of the menu bar.

Return Value

TRUE if successful; otherwise FALSE.

Remarks

After you construct a CMFCMenuBar object, you must call Create. This method creates the CMFCMenuBar control and attaches it to the CMFCMenuBar object.

For more information about toolbar styles, see CBasePane::SetPaneStyle.

CMFCMenuBar::CreateEx

Creates a CMFCMenuBar object with specified extended styles.

virtual BOOL CreateEx(
    CWnd* pParentWnd,
    DWORD dwCtrlStyle = TBSTYLE_FLAT,
    DWORD dwStyle = AFX_DEFAULT_TOOLBAR_STYLE,
    CRect rcBorders = CRect(1,
    1,
    1,
    1),
    UINT nID =AFX_IDW_MENUBAR);

Parameters

pParentWnd
[in] Pointer to the parent window of the new CMFCMenuBar object.

dwCtrlStyle
[in] Additional styles for the new menu bar.

dwStyle
[in] The main style of the new menu bar.

rcBorders
[in] A CRect parameter that specifies the sizes for the borders of the CMFCMenuBar object.

nID
[in] The ID for the child window of the menu bar.

Return Value

Nonzero if the method is successful; otherwise 0.

Remarks

You should use this function instead of CMFCMenuBar::Create when you want to specify styles in addition to the toolbar style. Some frequently used additional styles are TBSTYLE_TRANSPARENT and CBRS_TOP.

For lists of additional styles, see Toolbar Control and Button Styles, common control styles, and common window styles.

Example

The following example demonstrates how to use the CreateEx method of the CMFCMenuBar class. This code snippet is part of the IE Demo sample.

CMFCMenuBar m_wndMenuBar;
// The this pointer points to CMainFrame class which extends the CFrameWnd class.
if (!m_wndMenuBar.CreateEx(this, TBSTYLE_TRANSPARENT))
{
   TRACE0("Failed to create menubar\n");
   return -1; // fail to create
}

CMFCMenuBar::CreateFromMenu

Initializes a CMFCMenuBar object. This method models the CMFCMenuBar object after a HMENU parameter.

virtual void CreateFromMenu(
    HMENU hMenu,
    BOOL bDefaultMenu = FALSE,
    BOOL bForceUpdate = FALSE);

Parameters

hMenu
[in] A handle to a menu resource. CreateFromMenu uses this resource as a template for the CMFCMenuBar.

bDefaultMenu
[in] A Boolean that indicates whether the new menu is the default menu.

bForceUpdate
[in] A Boolean that indicates whether this method forces a menu update.

Remarks

Use this method if you want a menu control to have the same menu items as a menu resource. You call this method after you call either CMFCMenuBar::Create or CMFCMenuBar::CreateEx.

CMFCMenuBar::EnableHelpCombobox

Enables a Help combo box that is located on the right side of the menu bar.

void EnableHelpCombobox(
    UINT uiID,
    LPCTSTR lpszPrompt = NULL,
    int nComboBoxWidth = 150);

Parameters

uiID
[in] The command ID for the button of the Help combo box.

lpszPrompt
[in] A string that contains the text that the framework displays in the combo box if it is empty and not active. For example, "Enter the text here".

nComboBoxWidth
[in] The width of the button for the combo box in pixels.

Remarks

The Help combo box resembles the Help combo box in the menu bar of Microsoft Word.

When you call this method with uiID set to 0, this method hides the combo box. Otherwise, this method displays the combo box automatically on the right side of your menu bar. After you call this method, call CMFCMenuBar::GetHelpCombobox to obtain a pointer to the inserted CMFCToolBarComboBoxButton object.

CMFCMenuBar::EnableMenuShadows

Enables shadows for pop-up menus.

static void EnableMenuShadows(BOOL bEnable = TRUE);

Parameters

bEnable
[in] A Boolean parameter that indicates whether shadows should be enabled for pop-up menus.

Remarks

The algorithm that this method uses is complex and may decrease the performance of your application on slower systems.

CMFCMenuBar::GetAvailableExpandSize

virtual int GetAvailableExpandSize() const;

Return Value

Remarks

CMFCMenuBar::GetColumnWidth

virtual int GetColumnWidth() const;

Return Value

Remarks

CMFCMenuBar::GetDefaultMenu

Retrieves a handle to the original menu. The framework loads the original menu from the resource file.

HMENU GetDefaultMenu() const;

Return Value

A handle to a menu resource.

Remarks

If your application customizes a menu, you can use this method to retrieve a handle to the original menu.

CMFCMenuBar::GetDefaultMenuResId

Retrieves the resource identifier for the default menu.

UINT GetDefaultMenuResId() const;

Return Value

A menu resource identifier.

Remarks

The framework loads the default menu for the CMFCMenuBar object from the resource file.

CMFCMenuBar::GetFloatPopupDirection

int GetFloatPopupDirection(CMFCToolBarMenuButton* pButton);

Parameters

[in] pButton

Return Value

Remarks

CMFCMenuBar::GetForceDownArrows

BOOL GetForceDownArrows();

Return Value

Remarks

CMFCMenuBar::GetHelpCombobox

Returns a pointer to the Help combo box.

CMFCToolBarComboBoxButton* GetHelpCombobox();

Return Value

A pointer to the Help combo box. NULL if the Help combo box is hidden or not enabled.

Remarks

The Help combo box is located on the right side of the menu bar. Call the method CMFCMenuBar::EnableHelpCombobox to enable this combo box.

CMFCMenuBar::GetHMenu

Retrieves the handle to the menu attached to the CMFCMenuBar object.

HMENU GetHMenu() const;

CMFCMenuBar::GetMenuFont

Retrieves the current menu font.

static const CFont& GetMenuFont(BOOL bHorz = TRUE);

Parameters

bHorz
[in] A Boolean parameter that specifies whether to return the horizontal or vertical font. TRUE indicates the horizontal font.

Return Value

A pointer to a CFont parameter that contains the current menu bar font.

Remarks

The returned font is a global parameter for the application. Two global fonts are maintained for all CMFCMenuBar objects. These separate fonts are used for horizontal and vertical menu bars.

CMFCMenuBar::GetMenuItem

Retrieves a CMFCToolBarButton object on a menu bar based on the item index.

CMFCToolBarButton* GetMenuItem(int iItem) const;

Parameters

iItem
[in] The index of the menu item to return.

Return Value

A pointer to the CMFCToolBarButton object that matches the index specified by iItem. NULL if the index is invalid.

CMFCMenuBar::GetRowHeight

virtual int GetRowHeight() const;

Return Value

Remarks

CMFCMenuBar::GetSystemButton

CMFCToolBarMenuButtonsButton* GetSystemButton(
    UINT uiBtn,
    BOOL bByCommand = TRUE) const;

Parameters

[in] uiBtn

[in] bByCommand

Return Value

Remarks

CMFCMenuBar::GetSystemButtonsCount

int GetSystemButtonsCount() const;

Return Value

Remarks

CMFCMenuBar::GetSystemMenu

CMFCToolBarSystemMenuButton* GetSystemMenu() const;

Return Value

Remarks

CMFCMenuBar::HighlightDisabledItems

Controls whether the framework highlights disabled menu items.

static void HighlightDisabledItems(BOOL bHighlight = TRUE);

Parameters

bHighlight
[in] A Boolean parameter that indicates whether the framework highlights unavailable menu items.

Remarks

By default, the framework does not highlight unavailable menu items when the user positions the mouse pointer over them.

CMFCMenuBar::IsButtonExtraSizeAvailable

virtual BOOL IsButtonExtraSizeAvailable() const;

Return Value

Remarks

CMFCMenuBar::IsHighlightDisabledItems

Indicates whether the framework highlights unavailable menu items.

static BOOL IsHighlightDisabledItems();

Return Value

TRUE if unavailable menu items are highlighted; otherwise FALSE.

Remarks

By default, the framework does not highlight unavailable menu items when the user positions the mouse pointer over them. Use the CMFCMenuBar::HighlightDisabledItems method to enable this feature.

CMFCMenuBar::IsMenuShadows

Indicates whether the framework draws shadows for pop-up menus.

static BOOL IsMenuShadows();

Return Value

TRUE if the framework draws menu shadows; otherwise FALSE.

Remarks

Use the CMFCMenuBar::EnableMenuShadows method to enable or disable this feature.

CMFCMenuBar::IsRecentlyUsedMenus

Indicates whether recently used menu commands are displayed on the menu bar.

static BOOL IsRecentlyUsedMenus();

Return Value

Nonzero if the CMFCMenuBar object shows recently used menu commands; otherwise 0.

Remarks

Use the function CMFCMenuBar::SetRecentlyUsedMenus to control whether the menu bar shows recently used menu commands.

CMFCMenuBar::IsShowAllCommands

Indicates whether menus display all commands.

static BOOL IsShowAllCommands();

Return Value

Nonzero if the CMFCMenuBar displays all commands; otherwise 0.

Remarks

A CMFCMenuBar object can be configured to either show all commands or show only a subset of commands. For more information about this feature, see CMFCMenuBar Class.

IsShowAllCommands will tell you how this feature is configured for the CMFCMenuBar object. To control which menu commands are shown, use the methods CMFCMenuBar::SetShowAllCommands and CMFCMenuBar::SetRecentlyUsedMenus.

CMFCMenuBar::IsShowAllCommandsDelay

Indicates whether the CMFCMenuBar object displays all the commands after a short delay.

static BOOL IsShowAllCommandsDelay();

Return Value

Nonzero if the menu bar displays full menus after a short delay; otherwise 0.

Remarks

When you configure a menu bar to display recently used items, the menu bar displays the full menu in one of two ways:

  • Display the full menu after a programmed delay from when the user hovers the cursor over the arrow at the bottom of the menu.

  • Display the full menu after the user clicks the arrow at the bottom of the menu.

By default, all CMFCMenuBar objects use the option to display the full menu after a short delay. This option cannot be changed programmatically in the CMFCMenuBar class. However, a user can change the behavior during toolbar customization by using the Customize dialog box..

CMFCMenuBar::LoadState

Loads the state of the menu bar from the Windows registry.

virtual BOOL LoadState(
    LPCTSTR lpszProfileName = NULL,
    int nIndex = -1,
    UINT uiID = (UINT)-1);

Parameters

lpszProfileName
[in] A string that contains the path of a Windows registry key.

nIndex
[in] The control ID for the menu bar.

uiID
[in] A reserved value.

Return Value

TRUE if the method was successful; otherwise FALSE.

Remarks

Use the CMFCMenuBar::SaveState method to save the state of the menu bar to the registry. The saved information includes the menu items, the dock state, and the position of the menu bar.

In most cases your application does not call LoadState. The framework calls this method when it initializes the workspace.

CMFCMenuBar::OnChangeHot

virtual void OnChangeHot(int iHot);

Parameters

[in] iHot

Remarks

CMFCMenuBar::OnDefaultMenuLoaded

The framework calls this method when it loads the menu resource from the resource file.

virtual void OnDefaultMenuLoaded(HMENU hMenu);

Parameters

hMenu
[in] The handle for the menu attached to the CMFCMenuBar object.

Remarks

The default implementation of this function does nothing. Override this function to execute custom code after the framework loads a menu resource from the resource file.

CMFCMenuBar::OnSendCommand

virtual BOOL OnSendCommand(const CMFCToolBarButton* pButton);

Parameters

[in] pButton

Return Value

Remarks

CMFCMenuBar::OnSetDefaultButtonText

The framework calls this method when the user changes the text of an item on the menu bar.

virtual BOOL OnSetDefaultButtonText(CMFCToolBarButton* pButton);

Parameters

pButton
[in] A pointer to the CMFCToolBarButton object that the user wants to customize.

Return Value

TRUE if the framework applies the user changes to the menu bar; otherwise FALSE.

Remarks

The default implementation for this method changes the text of the button to the text that the user provides.

CMFCMenuBar::OnToolHitTest

virtual INT_PTR OnToolHitTest(
    CPoint point,
    TOOLINFO* pTI) const;

Parameters

[in] point

[in] pTI

Return Value

Remarks

CMFCMenuBar::PreTranslateMessage

virtual BOOL PreTranslateMessage(MSG* pMsg);

Parameters

[in] pMsg

Return Value

Remarks

CMFCMenuBar::RestoreOriginalstate

Called by the framework when the user selects Reset from the Customize dialog box.

virtual BOOL RestoreOriginalstate();

Return Value

Nonzero if the method is successful; otherwise 0.

Remarks

This method is called when the user selects Reset from the customization menu. You can also manually call this method to programmatically reset the state of the menu bar. This method loads the original state from the resource file.

Override this method if you want to do any processing when the user selects the Reset option.

CMFCMenuBar::SaveState

Saves the state of the CMFCMenuBar object to the Windows registry.

virtual BOOL SaveState (
    LPCTSTR lpszProfileName = NULL,
    int nIndex = -1,
    UINT uiID = (UINT)-1);

Parameters

lpszProfileName
[in] A string that contains the path of a Windows registry key.

nIndex
[in] The control ID for the menu bar.

uiID
[in] A reserved value.

Return Value

TRUE if successful; otherwise FALSE;

Remarks

Usually, your application does not call SaveState. The framework calls this method when the workspace is serialized. For more information, see CWinAppEx::SaveState.

The saved information includes the menu items, the dock state, and the position of the menu bar.

CMFCMenuBar::SetDefaultMenuResId

Sets the default menu for a CMFCMenuBar object based on the resource ID.

void SetDefaultMenuResId(UINT uiResId);

Parameters

uiResId
[in] The resource ID for the new default menu.

Remarks

The CMFCMenuBar::RestoreOriginalstate method restores the default menu from the resource file.

Use the CMFCMenuBar::GetDefaultMenuResId method to retrieve the default menu without restoring it.

CMFCMenuBar::SetForceDownArrows

void SetForceDownArrows(BOOL bValue);

Parameters

[in] bValue

Remarks

CMFCMenuBar::SetMaximizeMode

The framework calls this method when a MDI changes its display mode and the menu bar must be updated.

void SetMaximizeMode(
    BOOL bMax,
    CWnd* pWnd = NULL,
    BOOL bRecalcLayout = TRUE);

Parameters

bMax
[in] A Boolean that specifies the mode. See the Remarks section for more information.

pWnd
[in] A pointer to the MDI child window that is changing.

bRecalcLayout
[in] A Boolean that specifies whether the layout of the menu bar should be recalculated immediately.

Remarks

When an MDI child window is maximized, a menu bar attached to the MDI main frame window displays the system menu and the Minimize, Maximize and Close buttons. If bMax is TRUE and pWnd is not NULL, the MDI child window is maximized and the menu bar must incorporate the extra controls. Otherwise, the menu bar returns to its regular state.

CMFCMenuBar::SetMenuButtonRTC

Sets the runtime class information that the framework uses when the user creates menu buttons.

void SetMenuButtonRTC(CRuntimeClass* pMenuButtonRTC);

Parameters

pMenuButtonRTC
[in] The CRuntimeClass information for a class derived from the CMFCMenuButton Class.

Remarks

When a user adds new buttons to the menu bar, the framework creates the buttons dynamically. By default, it creates CMFCMenuButton objects. Override this method to change the type of button objects that the framework creates.

CMFCMenuBar::SetMenuFont

Sets the font for all menu bars in your application.

static BOOL SetMenuFont(
    LPLOGFONT lpLogFont,
    BOOL bHorz = TRUE);

Parameters

lpLogFont
[in] A pointer to a LOGFONT structure that defines the font to set.

bHorz
[in] TRUE if you want the lpLogFont parameter to be used for the vertical font, FALSE if you want it to be used for horizontal font.

Return Value

TRUE if the method was successful; otherwise FALSE.

Remarks

Two fonts are used for all CMFCMenuBar objects. These separate fonts are used for horizontal and vertical menu bars.

The font settings are global variables and affect all CMFCMenuBar objects.

CMFCMenuBar::SetRecentlyUsedMenus

Controls whether a menu bar displays recently used menu commands.

static void SetRecentlyUsedMenus (BOOL bOn = TRUE);

Parameters

bOn
[in] A Boolean that controls whether recently used menu commands are displayed.

CMFCMenuBar::SetShowAllCommands

Controls whether a menu shows all the available commands.

static void SetShowAllCommands(BOOL bShowAllCommands = TRUE);

Parameters

bShowAllCommands
[in] A Boolean parameter that specifies whether the pop-up menu shows all the menu commands.

Remarks

If a menu does not display all the menu commands, it hides the commands that are rarely used. For more information about displaying menu commands, see CMFCMenuBar Class.

See also

Hierarchy Chart
Classes
CMFCToolBar Class