Important: The information in this document is obsolete and should not be used for new development.
GetMenuHandle
You can use theGetMenuHandlefunction to get a handle to the menu record of any of your application's menus other than its Help menu. (Use theHMGetHelpMenuHandlefunction to get a handle to the menu record of your application's Help menu.) The GetMenuHandle function is also available as the GetMHandle function.
FUNCTION GetMenuHandle (menuID: Integer): MenuHandle;
menuID- The menu ID of the menu. (Note that this is not the resource ID,
although you often assign the menu ID so that it matches the resource ID.) You assign a menu ID in the'MENU'resource of a menu. If you
do not define your menus in'MENU'resources, you can assign a menu
ID usingNewMenu.DESCRIPTION
TheGetMenuHandlefunction returns a handle to the menu record of the menu having the specified menu ID. If the menu is in the current menu list,GetMenuHandlereturns a handle to the menu record of the menu as its function result. Otherwise,GetMenuHandlereturnsNILas its function result.SPECIAL CONSIDERATIONS
To get a handle to a menu record of a pop-up menu that you create using the pop-up control definition function, dereference thecntrlDatafield of the pop-up menu's control record instead of usingGetMenuHandle.