Important: The information in this document is obsolete and should not be used for new development.
InsertMenu
Use theInsertMenu
procedure to insert an existing menu into the current menu list.
PROCEDURE InsertMenu (theMenu: MenuHandle; beforeID: Integer);
theMenu
- A handle to the menu record of the menu. The
NewMenu
andGetMenu
functions return a handle to a menu record that you can use in this parameter.beforeID
- A number that indicates where in the current menu list the menu should be inserted.
InsertMenu
inserts the menu into the current menu list before the menu whose menu ID equals the number specified in thebeforeID
parameter. If the number in thebeforeID
parameter is 0 (or it isn't the ID of any menu in the menu list),InsertMenu
adds the new menu after all others (except before the Help, Keyboard, and Application menus). If the menu is already in the current menu list or the menu list is already full,InsertMenu
does nothing.- You can specify -1 for the
beforeID
parameter to insert a submenu into the current menu list. The submenus in the submenu portion of the menu list do not have to be currently associated with a hierarchical menu item; you can store submenus in the menu list and later specify that a menu item has a submenu if needed. However, note that theMenuKey
function scans all menus in the menu list for keyboard equivalents, including submenus that are not associated with any menu item. You should not define keyboard equivalents for submenus that are in the current menu list but not associated with a menu item.- You can also specify -1 for the
beforeID
parameter to insert a pop-up menu into the current menu list. However, if you use the standard
pop-up control definition function, the pop-up control automatically inserts the menu into the current menu list according to the needs of the pop-up control.DESCRIPTION
TheInsertMenu
procedure inserts into the current menu list the menu identified by the specified handle to a menu record. To update the menu bar to reflect the new menu, useDrawMenuBar
.SEE ALSO
For details on how to update your application's menu bar, see the description ofDrawMenuBar
on page 3-115.