Important: The information in this document is obsolete and should not be used for new development.
Creating Menus
You can use theNewMenuorGetMenufunction to create a pull-down menu, although you usually create all the menus in your menu bar at once by providing an'MBAR'resource and using theGetNewMBarfunction. See "Getting and Setting the Menu Bar" on page 3-114 for information on creating a menu bar. You typically use theNewMenuorGetMenufunction to create submenus or pop-up menus.The
NewMenufunction creates a menu with the specified title, assigns it the specified menu ID, and creates a menu record for the menu. UseAppendMenu,InsertMenuItem,AppendResMenu, orInsertResMenuto add items to menus you create withNewMenu.The
GetMenufunction creates a menu with the title, items, and characteristics defined in a specified'MENU'resource.Both
NewMenuandGetMenuallocate space in your application's heap for the menu record and return a handle to the menu's newly created menu record.To add menus created by
NewMenuorGetMenuto the current menu list, use theInsertMenuprocedure. To update the menu bar with any new menu titles, useDrawMenuBar.
Subtopics
- NewMenu
- GetMenu