Important: The information in this document is obsolete and should not be used for new development.
HMGetHelpMenuHandle
Use theHMGetHelpMenuHandle
function to get a handle to the menu record of your application's Help menu.
FUNCTION HMGetHelpMenuHandle (VAR mh: MenuHandle): OSErr;
mh
- The
HMGetHelpMenuHandle
function returns a copy of a handle to your application's Help menu in this parameter.DESCRIPTION
TheHMGetHelpMenuHandle
function returns in themh
parameter a copy of a handle to the menu record of your application's Help menu. With this handle, you can append items to your application's Help menu by using theAppendMenu
procedure or other related Menu Manager routines. The Help Manager automatically adds the divider that separates your items from the rest of the Help menu items.Be sure to define help balloons for your items in the Help menu by creating an
'hmnu'
resource and specifying thekHMHelpMenuID
constant as its resource ID.The Menu Manager functions
MenuSelect
andMenuKey
return a result with the menu ID in the high-order word and the menu item in the low-order word. TheMenuSelect
function (and theMenuKey
function, if the user chooses an item with a keyboard equivalent) returns thekHMHelpMenuID
constant in the high-order word when the user chooses an appended item from the Help menu. The menu item number of the appended menu item is returned in the low-order word of the function result. Apple reserves the right to change the number of standard items in the Help menu. To determine the number of items in the Help menu, call theCountMItems
function.SPECIAL CONSIDERATIONS
Do not use theGetMenuHandle
function to get a handle to the menu record of the Help menu.GetMenuHandle
returns a handle to the menu record of the global Help menu, not the menu record of the Help menu that is specific to your application.RESULT CODES
noErr 0 No error paramErr -50 Error in parameter list memFullErr -108 Not enough room in heap zone resNotFound -192 Unable to read resource hmHelpManagerNotInited -855 Help menu not set up SEE ALSO
For examples of how to add items to your application's Help menu and how to handle the user's choice of an item in the Help menu, see Listing 3-14 on page 3-68 and
Listing 3-26 on page 3-81. See the chapter "Help Manager" in Inside Macintosh: More Macintosh Toolbox for information on creating help balloons for the menus of
your application.