Important: The information in this document is obsolete and should not be used for new development.
HMGetHelpMenuHandle
To append items to the Help menu, use theHMGetHelpMenuHandle
function.
FUNCTION HMGetHelpMenuHandle (VAR mh: MenuHandle): OSErr;
mh
- A copy of a handle to the Help menu.
DESCRIPTION
TheHMGetHelpMenuHandle
function returns in itsmh
parameter a handle to your application's help menu. With this handle, you can append items to the Help menu by using theAppendMenu
procedure or other related Menu Manager routines. The Help Manager automatically adds the divider line that separates your items from the rest of the Help menu.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 word and the menu item in the low word. Both functions return theHelpMgrID
constant in the high word when the user chooses an appended item from the Help menu. The number of the appended menu item is returned in the low word
of the function result. In the future, Apple Computer, Inc., may choose to add other items to the Help menu. To determine the number of items in the Help menu, call the Menu Manager functionCountMItems
.SPECIAL CONSIDERATIONS
Do not use the Menu Manager functionGetMenuHandle
to get a handle to the Help menu, becauseGetMenuHandle
returns a handle to the global Help menu, not the
Help menu that is specific to your application.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theHMGetHelpMenuHandle
function are
Trap macro Selector _Pack14 $0200 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
"Adding Menu Items to the Help Menu" beginning on page 3-83 provides details and illustrative sample code for usingHMGetHelpMenuHandle
. The'hmnu'
resource is described in detail in "Providing Help Balloons for Menus" beginning on page 3-24. See the chapter "Menu Manager" in Inside Macintosh: Macintosh Toolbox Essentials for information aboutAppendMenu
,MenuSelect
,MenuKey
, and other Menu Manager routines.