LESSON 10 - Using Microsoft Help Workshop
LESSON 10 - Using Microsoft Help Workshop
LESSON 10 - Using Microsoft Help Workshop
10
Using Microsoft Help Workshop 4.0
The Microsoft Help Workshop 4.0 is a set of tools, separate from Visual Basic, that you use to
create help files for applications that run under 32-bit Windows systems. The Help Workshop is
shipped on the same CD-ROM on which you received your copy of Visual Basic 6.0, in the
directory \Tools\Hcw. You invoke Setup.exe to install the Help Workshop on your computer.
You create your help data by using any word processor that supports footnotes and the Rich Text
Format (.rtf). Then you "compile" the RTF files and the help project file (.hpj) with the Help
compiler to create the help file.
You make a help file by using a special footnote markup language in Rich Text Format. The RTF
file is constructed in three sections: the jump text, the topic text, and the footnote tags.
The heart of the help document structure is the topic, a section of Rich Text bounded with a page
break. The first line of the section is footnoted with at least the special footnote character #. You
enter the topic ID of the topic section next to this character in the footnote area of the RTF file. (A
topic ID is a location address of the given topic within the RTF file.).
The sections interact by the use of strikethrough text to indicate that the characters of that text
are hypertext. You place text formatted as hidden after the strikethrough text. The text formatted
as hidden is the jump-to address that will be referenced by the strikethrough text. The contents of
the jump-to address is formally known as the Topic ID. When you run the RTF file through the
Help Workshop's Help Compiler, the strikethrough text is transformed into hypertext. When users
click the hypertext, the Help runtime engine (WinHelp.exe) looks to the text that was formatted as
Hidden and placed after the strikethrough characters for the address of where to jump. Then,
after the engine knows the address, it looks in the footnote section for the location of that address
within the help file. The engine then goes to the topic at that address and displays the
information.
To get help for the menu you are interested in, click a
topic:
1. Launch the Help Workshop by choosing Microsoft Help Workshop from the Programs
submenu of the Start menu, or by finding and double-clicking HCW.EXE in Windows
Explorer.
2. Choose New from the File menu.
3. In the New dialog, select New Help Project. Save the new project as helper.hpj
4. Click File on the right side of the Workshop to access the Topic File dialog. Click Add to
display the Open File dialog.
5. Select the helper.rtf and click OK to add it to the Help Workshop
6. To compile the .RTF file into an .HLP file, click Save and Compile at the bottom right of
the Help Workshop.
7. You can view the finished help project file by going into the location where you save it
and double-clicking the helper.hpj
To display a Help File to your Visual Basic Application, you can use the WINDOWS API function
WinHelp:
Here are the possible values you can use for the wCommand argument:
• HELP_CONTEXT = &H1
• HELP_QUIT = &H2
• HELP_INDEX = &H3
• HELP_CONTENTS = &H3&
• HELP_HELPONHELP = &H4
• HELP_SETINDEX = &H5
• HELP_SETCONTENTS = &H5&
• HELP_CONTEXTPOPUP = &H8&
• HELP_FORCEFILE = &H9&
• HELP_KEY = &H101
• HELP_COMMAND = &H102&
• HELP_PARTIALKEY = &H105&
• HELP_MULTIKEY = &H201&
• HELP_SETWINPOS = &H203&
Let’s see an example. Here, we’ll open the helper.hlp Help file in an application named “helper”
when the user selects the Help item in the application’s Help menu. To start, we declare WinHelp
and the constants it can use:
Then, when the user selects the appropriate menu item, we display the helper.hlp file with
WinHelp this
way:
And that’s it—now the user can open the helper.hlp file from the Visual Basic helper application.
Information and Communication Technology Department 80
Palompon Institute of Technology