Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CMenu::EnableMenuItem
CMenu                                       Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  UINT EnableMenuItem( UINT nIDEnableItem, UINT nEnable );
 
  Parameter       Description
 
  <nIDEnableItem> Specifies the menu item to be enabled, as determined by
                  <nEnable>.
 
  <nEnable>       Specifies the action to take. It can be a combination of
                  MF_DISABLED, MF_ENABLED, or MF_GRAYED, with MF_BYCOMMAND
                  or MF_BYPOSITION. These values can be combined by using
                  the bitwise-OR operator. These values have the following
                  meanings:
 
                  Value           Interpretation of <nEnable>
 
                  MF_BYCOMMAND    Specifies that the parameter gives the
                                  command ID of the existing menu item.
                                  This is the default if neither
                                  MF_BYCOMMAND nor MF_BYPOSITION is set.
 
                  MF_BYPOSITION   Specifies that the parameter gives the
                                  position of the existing menu item (the
                                  first item is at position 0).
 
                  MF_DISABLED     Disables the menu item so that it cannot
                                  be selected, but does not dim it.
 
                  MF_ENABLED      Enables the menu item so that it can be
                                  selected, and restores it from its
                                  dimmed state.
 
                  MF_GRAYED       Disables the menu item so that it cannot
                                  be selected, and dims it.
 
  Remarks
 
  Enables, disables, or dims a menu item.
 
  Return Value
 
  Previous state (MF_DISABLED, MF_ENABLED, or MF_GRAYED) or -1 if not
  valid.
 
  See Also
 
  CMenu::GetMenuState, ::EnableMenuItem
 
 
                                     -♦-