If you wish to implement WhatsThisHelp from an HTML Help file,
you must include the following:
So-called "context-sensitive" or "Pop-up" Topic files. One of these files can contain many small "one
liner" WhatsThisHelp topics as well as a unique constant name to identify each topic.
Topic ID mapping files. This second type of file format is identical to the format
of the *.h file described above for mapping HelpContextID topics. The purpose of this
file is to map each of the unique constant names defined in the Pop-Up Topic file to
a numeric Topic ID.
You include these two files in
an HTML Help project by specifying them under
the [TEXT POPUPS] section of the HTML Help project
file (*.hhp), as described in the following
A context-sensitive Topic file
(*.txt) is a text file that associates a unique
constant name with some brief text that you
can use in a WhatsThisHelp system in VB.
The format for each WhatsThisHelp
topic entry is:
Text of Topic
ConstName is a unique identifier
that will later be used to link the topic to
a Topic ID (see the following section) and Text
of Topic is the text that the user will actually
see when WhatsThisHelp pops up.
Listing 7.6 gives a sample of
such a file.
A SAMPLE HTML HELP TOPIC FILE FOR TEXT POPUP
Required for Tax status.
Has medical insurance
Topic ID Mapping Files
Just as you must map constant
names to numeric values for HelpContextIDs,
so must you map WhatsThisHelp topic constants
to numeric values for WhatsThisHelpIDs. You
use a Context-Sensitive Mapping file (*.h) to
accomplish this. The format of each line in
such a file is the same as the format of the
lines in a mapping file for HelpContextID constants:
Listing 7.7 gives an example
of the contents of a Context-Sensitive Topic
ID mapping file.
A TEXT POPUP (WHATSTHISHELP) TOPIC ID MAPPING
#define IDH_MARITALSTATUS 20
#define IDH_MEDICALINSURANCE 30
WHATSTHISHELP Files in the HTML Help Project
After you've created a
Context-Sensitive Topic and Context-Sensitive
Topic ID mapping file as described in the previous
two sections, you can include them in the HTML
Help project by following these steps:
STEP BY STEP
7.4 Associating Topic Files With Topic IDs
Click the HTMLHelp API Information icon (the fourth Toolbar button from the
top on the vertical toolbar along the left of the HTML Workshop's main screen)
to bring up the HTMLHelp API Information dialog box (refer to Figure 7.20).
On the Text Pop-ups tab of this dialog box, click the Header File button to
bring up the Include File dialog box. Then browse to and select the mapping file
that you created for Pop-Up Topic IDs (Figure 7.25). After the file is selected,
click OK to return to the Text Pop-ups tab.
FIGURE 7.25. Selecting a Topic ID mapping file for WhatsThisHelp with the
Include File dialog box from the Text Pop-ups tab of the HTMLHelp API Information
On the Text Pop-ups tab, click the Text File button to bring up the Include
File dialog box. Then browse to and select the Context-Sensitive Topic ID file
(*.txt) that you created for Pop-up topics (Figure 7.26).
FIGURE 7.26. Selecting a Topic file for WhatsThisHelp with the Include File
dialog box from the Text Popups tab of the HTMLHelp API Information dialog box.
Click OK until you've returned to the main screen. You should now see a [TEXT
POPUPS] section in your project that includes the two files you just selected
(refer to Figure 7.14).
<< Previous | Contents
| Next (Chapter 8) >>