Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

CFrameWnd::m_bAutoMenuEnable

When this data member is enabled (which is the default), menu items that do not have ON_UPDATE_COMMAND_UI or ON_COMMAND handlers will be automatically disabled when the user pulls down a menu.

BOOL m_bAutoMenuEnable;

Menu items that have an ON_COMMAND handler but no ON_UPDATE_COMMAND_UI handler will be automatically enabled.

When this data member is set, menu items are automatically enabled in the same way that toolbar buttons are enabled.

Note Note

m_bAutoMenuEnable has no effect on top-level menu items.

This data member simplifies the implementation of optional commands based on the current selection and reduces the need to write ON_UPDATE_COMMAND_UI handlers for enabling and disabling menu items.

CMainFrame::CMainFrame()
   : m_hDrawMenu(NULL)
   , m_hDrawAccel(NULL)
   , m_bCheck(false)
   , m_nWindowTimer(0)
   , m_nCallbackTimer(0)
{
   // Set to FALSE so no ON_UPDATE_COMMAND_UI  
   // or ON_COMMAND handlers are needed, and 
   // CMenu::EnableMenuItem() will work as expected.
   m_bAutoMenuEnable = FALSE;
}

Header: afxwin.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.