Skip to content

Latest commit

 

History

History
202 lines (127 loc) · 5.61 KB

cmenutearoffmanager-class.md

File metadata and controls

202 lines (127 loc) · 5.61 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: CMenuTearOffManager Class
CMenuTearOffManager Class
10/18/2018
CMenuTearOffManager
AFXMENUTEAROFFMANAGER/CMenuTearOffManager
AFXMENUTEAROFFMANAGER/CMenuTearOffManager::CMenuTearOffManager
AFXMENUTEAROFFMANAGER/CMenuTearOffManager::Build
AFXMENUTEAROFFMANAGER/CMenuTearOffManager::GetRegPath
AFXMENUTEAROFFMANAGER/CMenuTearOffManager::Initialize
AFXMENUTEAROFFMANAGER/CMenuTearOffManager::IsDynamicID
AFXMENUTEAROFFMANAGER/CMenuTearOffManager::Parse
AFXMENUTEAROFFMANAGER/CMenuTearOffManager::Reset
AFXMENUTEAROFFMANAGER/CMenuTearOffManager::SetInUse
AFXMENUTEAROFFMANAGER/CMenuTearOffManager::SetupTearOffMenus
CMenuTearOffManager [MFC], CMenuTearOffManager
CMenuTearOffManager [MFC], Build
CMenuTearOffManager [MFC], GetRegPath
CMenuTearOffManager [MFC], Initialize
CMenuTearOffManager [MFC], IsDynamicID
CMenuTearOffManager [MFC], Parse
CMenuTearOffManager [MFC], Reset
CMenuTearOffManager [MFC], SetInUse
CMenuTearOffManager [MFC], SetupTearOffMenus
ab7ca272-ce42-4678-95f7-6ad75038f5a0

CMenuTearOffManager Class

Manages tear-off menus. A tear-off menu is a menu on the menu bar. The user can remove a tear-off menu from the menu bar, causing the tear-off menu to float.

For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

Syntax

class CMenuTearOffManager : public CObject

Members

Public Constructors

Name Description
CMenuTearOffManager::CMenuTearOffManager Constructs a CMenuTearOffManager object.

Public Methods

Name Description
CMenuTearOffManager::Build
CMenuTearOffManager::GetRegPath
CMenuTearOffManager::Initialize Initializes a CMenuTearOffManager object.
CMenuTearOffManager::IsDynamicID
CMenuTearOffManager::Parse
CMenuTearOffManager::Reset
CMenuTearOffManager::SetInUse
CMenuTearOffManager::SetupTearOffMenus

Remarks

In order to use tear-off menus in your application, you must have a CMenuTearOffManager object. In most cases, you won't create or initialize a CMenuTearOffManager object directly. This is handled for you when you call the CWinAppEx::EnableTearOffMenus function.

Example

The following example demonstrates how to construct and initialize a CMenuTearOffManager object by calling the CWinAppEX::EnableTearOffMenus method. This code snippet is part of the Word Pad sample.

[!code-cppNVC_MFC_WordPad#12]

Inheritance Hierarchy

CObject

CMenuTearOffManager

Requirements

Header: afxmenutearoffmanager.h

CMenuTearOffManager::Build

void Build(
    UINT uiTearOffBarID,
    CString& strText);

Parameters

[in] uiTearOffBarID

[in] strText

Remarks

CMenuTearOffManager::CMenuTearOffManager

Constructs a CMenuTearOffManager object.

CMenuTearOffManager();

Remarks

In most cases, you should not create a CMenuTearOffManager manually. The framework of your application creates the CMenuTearOffManager object when you call CWinAppEx::EnableTearOffMenus.

CMenuTearOffManager::GetRegPath

LPCTSTR GetRegPath() const;

Return Value

Remarks

CMenuTearOffManager::Initialize

Initializes a CMenuTearOffManager object.

BOOL Initialize(
    LPCTSTR lpszRegEntry,
    UINT uiTearOffMenuFirst,
    UINT uiTearOffMenuLast);

Parameters

lpszRegEntry
[in] A string that contains the path of a registry entry. Your applications stores the settings for tear-off bars in this registry entry.

uiTearOffMenuFirst
[in] The first menu ID for a tear-off menu.

uiTearOffMenuLast
[in] The last menu ID for a tear-off menu.

Return Value

Nonzero if successful; otherwise 0.

Remarks

The range of menu IDs from uiTearOffMenuFirst to uiTearOffMenuLast must be a continuous interval. The interval defines the number of tear-off menus that can appear at the same time in the application.

CMenuTearOffManager::IsDynamicID

BOOL IsDynamicID(UINT uiID) const;

Parameters

[in] uiID

Return Value

Remarks

CMenuTearOffManager::Parse

UINT Parse(CString& str);

Parameters

[in] str

Return Value

Remarks

CMenuTearOffManager::Reset

void Reset(HMENU hmenu);

Parameters

[in] hmenu

Remarks

CMenuTearOffManager::SetInUse

void SetInUse(
    UINT uiCmdId,
    BOOL bUse = TRUE);

Parameters

[in] uiCmdId

[in] bUse

Remarks

CMenuTearOffManager::SetupTearOffMenus

void SetupTearOffMenus(HMENU hMenu);

Parameters

[in] hMenu

Remarks

See also

Hierarchy Chart
Classes
CWinAppEx Class