Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: More Macintosh Toolbox /
Chapter 3 - Help Manager / Help Manager Reference
Help Manager Routines / Adding Items to the Help Menu


HMGetHelpMenuHandle

To append items to the Help menu, use the HMGetHelpMenuHandle function.

FUNCTION HMGetHelpMenuHandle (VAR mh: MenuHandle): OSErr;
mh
A copy of a handle to the Help menu.
DESCRIPTION
The HMGetHelpMenuHandle function returns in its mh parameter a handle to your application's help menu. With this handle, you can append items to the Help menu by using the AppendMenu 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 the kHMHelpMenuID constant as its resource ID.

The Menu Manager functions MenuSelect and MenuKey return a result with the menu ID in the high word and the menu item in the low word. Both functions return the HelpMgrID 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 function CountMItems.

SPECIAL CONSIDERATIONS
Do not use the Menu Manager function GetMenuHandle to get a handle to the Help menu, because GetMenuHandle 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 the HMGetHelpMenuHandle function are
Trap macroSelector
_Pack14$0200

RESULT CODES
noErr0No error
paramErr-50Error in parameter list
memFullErr-108Not enough room in heap zone
resNotFound-192Unable to read resource
hmHelpManagerNotInited-855Help 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 using HMGetHelpMenuHandle. 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 about AppendMenu, MenuSelect, MenuKey, and other Menu Manager routines.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996