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: Macintosh Toolbox Essentials /
Chapter 3 - Menu Manager / Menu Manager Reference
Menu Manager Routines / Getting a Handle to a Menu Record


HMGetHelpMenuHandle

Use the HMGetHelpMenuHandle 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
The HMGetHelpMenuHandle function returns in the mh 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 the AppendMenu 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 the kHMHelpMenuID constant as its resource ID.

The Menu Manager functions MenuSelect and MenuKey return a result with the menu ID in the high-order word and the menu item in the low-order word. The MenuSelect function (and the MenuKey function, if the user chooses an item with a keyboard equivalent) returns the kHMHelpMenuID 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 the CountMItems function.

SPECIAL CONSIDERATIONS
Do not use the GetMenuHandle 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
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
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.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996