CMFCCustomizeMenuButton Class

Represents a single button on a customization menu.

class CMFCCustomizeMenuButton : public CMFCToolBarMenuButton

Members

Public Constructors

Name

Description

CMFCCustomizeMenuButton::CMFCCustomizeMenuButton

Constructs a CMFCCustomizeMenuButton object.

CMFCCustomizeMenuButton::~CMFCCustomizeMenuButton

Destructor.

Public Methods

Name

Description

CMFCCustomizeMenuButton::CreateObject

Used by the framework to create a dynamic instance of this class type.

CMFCCustomizeMenuButton::EnableCustomization

Enables or disables menu button customization.

CMFCCustomizeMenuButton::GetParentToolbar

Retrieves the parent toolbar of the menu button.

CMFCCustomizeMenuButton::GetThisClass

Used by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type.

CMFCCustomizeMenuButton::IsCommandExist

Determines whether the given command ID is in the customization menu.

CMFCCustomizeMenuButton::RestoreRecentlyUsedState

Specifies whether a menu bar displays recently used menu commands.

CMFCCustomizeMenuButton::SetItemIndex

Updates the state of the menu button.

CMFCCustomizeMenuButton::SetParentToolbar

Sets the parent toolbar of the menu button.

CMFCCustomizeMenuButton::SetSeparator

Designates the menu button as a separator.

CMFCCustomizeMenuButton::SetSiblingsButton

Designates the menu button as a sibling button.

Remarks

This class supports the MFC framework infrastructure and is not intended to be used directly from your code.

The framework uses this class to display the customization menu. To enable this menu in your application, call the CMFCToolBar::EnableCustomizeButton method.

Example

The following example demonstrates how to get a CMFCCustomizeMenuButton object from a CMFCPopupMenuBar object, enable menu button customization, and designate the menu button as a separator. This code snippet is part of the DrawClient Sample: MFC Ribbon-Based OLE Object Drawing Application.

// CMFCPopupMenuBar* pMenuBar
    CMFCCustomizeMenuButton* pBtn = (CMFCCustomizeMenuButton*)pMenuBar->GetButton(0);
    pBtn->EnableCustomization(true);
    pBtn->SetSeparator();

Inheritance Hierarchy

CObject

   CMFCToolBarButton

      CMFCToolBarMenuButton

         CMFCCustomizeMenuButton

Requirements

Header: afxcustomizemenubutton.h

See Also

Concepts

MFC Hierarchy Chart

Other Resources

Classes (MFC Feature Pack)