Customizing the Help Menu

Users choose the How To Use Help command from the Help menu in the Windows Help application. To change the name of this command to something that more closely matches your instructional Help file, you can include the following Help macros in the [CONFIG] section of your Help project file:

[CONFIG]
   .
   .
   .
SetHelpOnFile("hlpbasic.hlp")
DeleteItem("mnu_HelpOn")
InsertItem("mnu_help", "mnu_hlpbas", "&Custom Help", "JC(`hlpbasic.hlp')", 0)
AddAccelerator(0x70, 0, "JC(`hlpbasic.hlp')")

These macros perform the following actions:

nThe SetHelpOnFile macro sets the custom Help file as HLPBASIC.HLP for this Help file.

nThe DeleteItem macro removes the default How To Use Help command from the Help menu.

nThe InsertItem macro adds the custom Help file (identified by “mnu_hlpbas”) to the Help menu (“mnu_help”) as the first item, before the Always On Top command.

nThe JumpContents (or JC) macro in the InsertItem macro opens the custom Help file, HLPBASIC.HLP, and jumps to the Contents topic for that file.

nThe AddAccelerator macro sets up the F1 key (hexadecimal code 0x70) as the keyboard accelerator for the custom Help command on the Help menu. This accelerator key opens the custom Help file the same as if the user chooses the Help command.

For more information about any of the macros discussed in this example, see Chapter 15, “Help Macro Reference.”

Adding Additional Items to the Help Menu

A Help menu may also include additional items. For example, it might include items that describe the following Help topics:

nTour of your Help file

nQuick Reference

You add additional menu items the same way as you added the main Help item: by using the InsertItem macro. Assuming the Help file is named HLPBASIC.HLP, the [CONFIG] section of HLPBASIC.HPJ might include the following macros:

[CONFIG]
   .
   .
   .
InsertItem("mnu_help", "mnu_tour", "Help &Tour", "JI(`hlpbasic.hlp>tour', `tour_start')", 1)
AddAccelerator(27, 0, "CloseWindow(`tour')")
InsertItem("mnu_help", "mnu_qkref", "&Quick Reference", "JI(`hlpbasic.hlp', `ref_idx')", 2)
AddAccelerator(0x52, 5, "JI(`hlpbasic.hlp', `ref_idx')")

These macros perform the following actions:

nCreate menu items named Help Tour and Quick Reference that appear on the Help menu in the second and third positions.

nSpecify which topic to display when users choose the commands: a topic identified by the context string “tour_start” for the Help Tour and a topic identified by the context string “ref_idx” for the Quick Reference.

nAssign keyboard equivalents to each menu item: the ESC key to close the Help Tour window and ALT+SHIFT+R to access the Quick Reference.