Starting Out with HtmlHelp

Environments: IE programming, HTML

Creating HTML Help Files for Your Applications

Creating cutting-edge applications is simply not enough these days. Users expect much more from an application. Providing a help file for your application has become an inductry standard. In the early days of Windows, back in 1995, Windows help came in only one flavour, simply called WinHelp. Now, with the integration of the Web in so many applications, even the help format has embraced this all-persave document format. Long live HTML!

You will need the following software to create HTML help files:

  • Microsoft HTML Help compiler
  • A text editor; Notepad will do fine
  • Image editing software such as PaintShop Pro

The entire tutorial for creating an HTML Help project is broken down into four steps. I recommend you read each of them in the order presented.

Note: You can download Microsoft's help compiler for free here.

Step 1: Decide Your Layout—Pages and Content

The very first thing you must do is list out the functionality of your application and note the areas where help is required. For example, if you have created an Address Book application, you will provide the following functionalities:

  • Adding a new contact
  • Editing a contact
  • Deleting a contact

It is easy to see that breaking up the help by the task that is to be performed will provide an easy and efficient help mechanism for the user. Therefore, we could decide to have three HTML pages, each explaining one of the functionalities and providing help for it.

Step 2: Adding the HTML Files to the Project

After creating the HTML pages, start the Microsoft HTML Help compiler. Select 'New' from the 'File' menu. Select 'Project' in the list of project/file types. Do not select any other options. The screen that you eventually will see should be like this:



Click here for a larger image.

To add the HTML files to your project, click the Contents tab. Specify a new Content File name, if asked and, save it in the same directory where the HTML files are present.

To add one of the HTML pages to the project, right-click on the empty space under the tabs as shown in the picture below.

Select Insert Topic from the popup-menu. A dialog box will be shown, called Table of Contents Entry.



Click here for a larger image.

Click the Add button to open the Path or URL dialog box. Click the Browse button and select the first HTML file. The Table of Contents Entry dialog box will be enabled. Type in a title for the Entry Title textbox and click OK. The newly added Topic (HTML file) should be listed under the tabs. Similarly, add other HTML files as required.

Step 3: Compiling

The final step is to compile the project. After all the HTML files are included as mentioned in Step 2, the project can be compiled.

Before compiling, final setting still need to be made. Click the Project tab. Double-click the [OPTIONS] item in the list to view the Options dialog box. Various project options can be set from here. Enter a suitable title for the help project in the General section.

Click the Files tab and make sure the Automatically Create Contents File... check box is unchecked.

After the options have been finalized, select Compile from the File menu. If all goes well, the compiler will create a .CHM help file.

Step 4: Calling the Help File from a Project

At the end of it all, one would want to call the help file from an application (executable file). The example shown here is for a Visual Basic project.

Add the following declaration to a VB project's .BAS module:

Public Const HH_DISPLAY_TOPIC = &H0
Public Const HH_HELP_CONTEXT  = &HF
Public Declare Function HtmlHelp Lib "HHCtrl.ocx" _
       Alias "HtmlHelpA" _
       (ByVal hwndCaller As Long, ByVal pszFile As String, _
        ByVal uCommand As Long, dwData As Any) As Long

This declaration is required to use the HTML Help API command from Visual Basic. To call a particular topic of the HTML help (.chm file), use this code:

Call HtmlHelp(0, "MyHelpFile.chm", HH_DISPLAY_TOPIC, _
              ByVal "Step3.htm")

Here, the last parameter specifies the HTML file to diplay in the Help viewer.

I hope you have enjoyed reading this article. If you find this tutotiral to be useful, I would really appreciate any comments or views on it. You can mail me at siddharthbarman@softhome.net.

Downloads

Download demo file - 143 Kb


Comments

  • Independent statement unwraps A few fresh new stuff over nike shoes that no company is discussing.

    Posted by moisseenfogma on 05/18/2013 08:53pm

    X [url=http://www.nikekutuja.biz/]nike スニーカー[/url] eiUah MqlGqt RebPfv Tpm [url=http://www.nikekutuja.biz/air-jordan空気ヨルダン-c-1.html]air jordan[/url] OvnJuhYzz Ca [url=http://www.nikekutuja.biz/air-maxエアマックス-c-2.html]ナイキ エアマックス[/url] zTqfZmzKry GyaGquUrb [url=http://www.nikekutuja.biz/nike-air-force-1ナイキエアフォース-c-4.html]air force[/url] Itn TfsFjj Ng [url=http://www.nikekutuja.com/]ナイキスニーカー[/url] cIto FafJyx WecByl GrxO [url=http://www.nikekutuja.com/air-jordan空気ヨルダン-c-1.html]air jordan[/url] olAlsTvl LsmQkyOakL [url=http://www.nikekutuja.com/nike-dunkナイキダンク-c-4.html]nike dunk low[/url] cq TeoNuxKd [url=http://www.nikekutuja.com/air-maxエアマックス-c-2.html]ナイキ エアマoックス[/url] kUol UzkXhi Og [url=http://www.nikekutujp.com/]nike running[/url] iSyb OcfUsg HajPtr IujC [url=http://www.nikekutujp.com/nike-dunkナイキダンク-c-4.html]nike store[/url] ggIhdDsi N [url=http://www.nikekutujp.com/nike-air-force-1ナイキエアフォース-c-3.html]air force[/url] izBkpXggRmo [url=http://www.nikekutujp.com/air-jordan空気ヨルダン-c-1.html]nike jordan[/url] ArtCrmDwoXrb YuhOhm

    Reply
  • Problems with hhctrl.ocx

    Posted by David Best on 04/28/2005 08:27am

    Has anyone had a problem with the latest version of hhctrl.ocx (5.2.3790.233 (srv03_gdr.040918-1552))?
    
    I'm finding that when this version is present on the PC (probably updated automatically by the windows update process), my contents pages won't display.  I have to revert back to the version 5.2.3735.0 and then it's ok again.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • It's no secret what keeps CIOs up at night. Mobile, cloud, data, security, and social have become the "five imperatives," the drivers of business progress, innovation, and competitive differentiation. Business leaders around the world want to hear how other companies are succeeding. How are they applying the latest technologies? How did they get started? What outcomes are they achieving? Read this online magazine for success stories from organizations like the NBA, Pfizer, and San Jose State University as they …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds