Help and Support
 

powered byLive Search

How To Prepare HTML Help Files for Context-Sensitive Help

Retired KB ArticleThis article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
Article ID:189453
Last Review:July 2, 2007
Revision:1.3
This article was previously published under Q189453
On This Page

SUMMARY

This article describes how to set up an HTML Help project file so that the HTML Help API command, HH_HELP_CONTEXT, can be used in an application. This is actually the first step of a two-step process. Step two is to set up your application to use the HTML Help API to invoke context-sensitive Help.

Back to the top

MORE INFORMATION

This article assumes that you already have an existing help project file to work with.

NOTE: It is recommended that you use a text editor, such as Microsoft Notepad or Microsoft WordPad, to edit the MAP and ALIAS sections of the HTML Help project file. For additional information, please see the following article in the Microsoft Knowledge Base:
188444 (http://support.microsoft.com/kb/188444/EN-US/) BUG: Editing MAP or ALIAS in the HTML Help Workshop Causes Error

Back to the top

Step-by-Step Procedures

1.Add the [ALIAS] section to the HTML Help project file. Following is an example of the [ALIAS] section:
[ALIAS]
IDH_FILE_NEW   = newfile.htm
IDH_FILE_OPEN  = openfile.htm
IDH_FILE_SAVE  = htm\savefile.htm
						
The purpose of the [ALIAS] section is to associate .htm files with constants. The constants are not defined in the [ALIAS] section (see the following step 2). The constants should not be numbers. For example, the following statement in the [ALIAS] section is not valid:
     5 = newfile.htm
						
NOTE: If an .htm file is in a subfolder, the name of the subfolder should be included. See IDH_FILE_SAVE in the above [ALIAS] section.
2.Add the [MAP] section to the HTML Help project file. The [MAP] section is required when you use an [ALIAS] section. The [MAP] section should appear after the [ALIAS] section. The purpose of the [MAP] section is to define or give numeric values to the constants in the [ALIAS] section. Following is an example of the [MAP] section:
[MAP]
#define IDH_FILE_NEW   1
#define IDH_FILE_OPEN  2
#define IDH_FILE_SAVE  3
						
NOTE: If the application that will use the Help files is written using Visual C++ the [MAP] section can also appear as follows:
[MAP]
#include "context.h"
						
In this case, the file Context.h contains the following define statements:
#define IDH_FILE_NEW   1
#define IDH_FILE_OPEN  2
#define IDH_FILE_SAVE  3
						
3.Save and close the project file with the text editor.
4.Open the project file in HTML Help Workshop, and compile it.

Test the compiled HTML Help file (.chm) by performing the following steps in HTML Help Workshop:

1.Open the project file.
2.From the Test menu, click HTMLHelp API.
3.In the Command list select HH_HELP_CONTEXT.
4.In the Window edit box, enter the name of a window defined in the [WINDOWS] section. If you do not have a [WINDOWS] section, this field should be blank.
5.In the Map Number edit box, enter a number defined in the [MAP] section. When you press the Test button, the correct topic should appear.

Back to the top

REFERENCES

HTML Help Web Site:
http://msdn2.microsoft.com/en-us/library/ms670169.aspx (http://msdn2.microsoft.com/en-us/library/ms670169.aspx)
For additional information, please see the following articles in the Microsoft Knowledge Base:
189086 (http://support.microsoft.com/kb/189086/EN-US/) How To Create Context-Sensitive HTML Help in a Visual Basic App
191118 (http://support.microsoft.com/kb/191118/EN-US/) How To Create Context-Sensitive HTML Help in an MFC Application

Back to the top


APPLIES TO
Microsoft HTML Help 1.3
Microsoft HTML Help 1.1
Microsoft HTML Help 1.21

Back to the top

Keywords: 
kbhowto KB189453

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.