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.
class CMenu
◄CObject►                                     ◄Up► ◄Contents► ◄Index► ◄Back►
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  Description
 
  The CMenu class is an encapsulation of the Windows HMENU. It provides
  member functions for creating, tracking, updating, and destroying menus.
  When you create a CMenu object, you associate it with a handle to a menu
  resource. Then you can use the class member functions to manage the
  menu.
 
  See Also
 
  ◄CObject►
 
  Public Members
 
  Construction/Destruction
 
  ◄CMenu►   Constructs a CMenu object.
 
  ◄~CMenu►   Destroys a CMenu object.
 
  Initialization
 
  ◄Attach►             Attaches a Windows menu handle to a CMenu object.
 
  ◄Detach►             Detaches a Windows menu handle from a CMenu object
                       and returns the handle.
 
  ◄CreateMenu►         Creates an empty menu and attaches it to a CMenu
                       object.
 
  ◄CreatePopupMenu►    Creates an empty pop-up menu and attaches it to a
                       CMenu object.
 
  ◄LoadMenu►           Loads a menu resource from the executable file and
                       attaches it to a CMenu object.
 
  ◄LoadMenuIndirect►   Loads a menu from a menu template in memory and
                       attaches it to a CMenu object.
 
  ◄DestroyMenu►        Destroys the menu attached to a CMenu object and
                       frees any memory that the menu occupied.
 
  Menu Operations
 
  ◄DeleteMenu►       Deletes a specified item from the menu. If the menu
                     item has an associated pop-up menu, destroys the
                     handle to the pop-up menu and frees the memory used
                     by it.
 
  ◄TrackPopupMenu►   Displays a floating pop-up menu at the specified
                     location and tracks the selection of items on the
                     pop-up menu.
 
  Menu Item Operations
 
  ◄AppendMenu►           Appends a new item to the end of this menu.
 
  ◄CheckMenuItem►        Places check marks next to or removes check marks
                         from menu items in the pop-up menu.
 
  ◄EnableMenuItem►       Enables, disables, or dims (grays) a menu item.
 
  ◄GetMenuItemCount►     Determines the number of items in a pop-up or
                         top-level menu.
 
  ◄GetMenuItemID►        Obtains the menu-item identifier for a menu item
                         located at the specified position.
 
  ◄GetMenuState►         Returns the status of the specified menu item or
                         the number of items in a pop-up menu.
 
  ◄GetMenuString►        Retrieves the label of the specified menu item.
 
  ◄GetSubMenu►           Retrieves a pointer to a pop-up menu.
 
  ◄InsertMenu►           Inserts a new menu item at the specified
                         position, moving other items down the menu.
 
  ◄ModifyMenu►           Changes an existing menu item at the specified
                         position.
 
  ◄RemoveMenu►           Deletes a menu item with an associated pop-up
                         menu from the specified menu.
 
  ◄SetMenuItemBitmaps►   Associates the specified check-mark bitmaps with
                         a menu item.
 
 
                                     -♦-