Category Archives: Microsoft HTML Help

Getting “HTML Help” in your CHM window title?

HTML_Help

Josée Lafleur, a Technical Writer and Translator at 20-20 Technologies based in Montreal, Canada emailed me recently with an interesting issue. Josée produces French and English content including tutorials, user guides and help files. Her issue was that the Microsoft HTML Help (CHM) files she creating did not display the correct window title. No matter what she set in RoboHelp’s project settings or window properties, the CHM file always displayed “HTML Help”.

A review of the Noughty’s – Part 1

David Farbey tweeted recently on how he had noticed how everyone had started summarising the years 2000 to 2009. As the end of a decade is such a momentous event (?) it is probably inevitable that editors struggling for a story during what is called “the silly season” turn to an easy fix. Not to be outdone, and honoring the fact that I have, officially at least, been a Technical Writer since 1999, I offer my own completely unscientific review of how the technical communication world has changed in the last ten years.

Note: I have split the review up into parts. Part One covers the migration from static offline help to user generated on line help.

Help….WinHelp!

In the good ol’ days when I had loads of money (pre-marriage) a full head of hair (also pre-marriage and pre-work) and technical communicators were easily pleased, I produced my first piece of documentation in WinHelp format. The sleek, familiar user interface made my first foray in technical writing a relative breeze. Oh how the mighty has fallen. One look at a WinHelp project these days makes me wince. OK there were some good things about it (e.g. non-scrolling regions) but on the whole it just doesn’t cut it in today’s feature rich, customer interaction environment. They just didn’t provide enough functionality for the discerning user and we Technical Writers just had to go. Whilst they are still used to this day, despite Microsoft’s best efforts, they are few and far between having largely been relegated to legacy help files for old and tired applications that have yet to be sunset or assigned a budget to upgrade.

The step to Microsoft HTML Help brought with it a rich stream of possibilities to improve user content. Like anything new it required a certain amount of getting used to, not least the fact that it was coded using HTML, but on the whole it was a huge step forward. Just the fact that you weren’t using MS Word as your editor was surely reason enough to change. However rather ironically a number of Help Authoring Tools surfaced that allowed you to generate the required HTML from a MS Word like interface. Now you could produce HTML in from a familiar interface without the vagaries of the familiar application! All of a sudden you could produce your HTML code without ever coding anything. Whilst it is possible to create your HTML topics in Notepad (I know someone who does even now) tools like Adobe RoboHelp provided an MS Word like user interface with which to produce your works of art. Microsoft HTML Help also brought with it a range of new gadgets and tools that allowed you to enrich your content (e.g. DHTML, browse sequences, forms, etc.).

However arguably even Microsoft HTML Help has its day. Whilst CHM files are still widely used and probably will be for sometime to come, the arrival of the Internet brought with it the need for online content. With the concept of a CHM being that they are designed to run on a local PC, we often used to see if we could bend the rules by placing them online. This worked to a degree but the incessant need for 100% security soon drove a dagger into any CHM file located online. They were deemed to be a risk and after Microsoft released Security Update 896358 in June 2005 they could no longer be effective unless located on a local drive.

Online help became the buzzword of the day. Outputs like WebHelp and FlashHelp gave Technical Writers the ability to change from being purely content providers to someone who could start to change the look and feel of the documentation we provided. The advent of skins allowed us to design the interface to the documentation as well as the documentation itself. What is more these outputs were more flexible allowing us to place them on internal intranets or an external site. Now our users could access the very latest documentation without having to install or upgrade an application. What is more, they could do so from anywhere provided they had an internet connection. All of a sudden staff in the field became enabled to find information quickly and easily.

Now I can’t let a review of output formats of the last ten years go by without mentioning my nemesis. For a short period after taking on my current position I was tasked with producing JavaHelp. The misguided decision made before I joined that this was the required output type because our application was written in Java was soon reversed! As soon as I pointed out the long list of its limitations and more importantly the negative feedback we were getting from users, particularly around searching, we managed to get agreement to change. If anything, it was this decision that highlights the changes that have occurred throughout my career. Namely that the documentation function has gone from something that costs, to something that can add real value to the product. The powers to be can see that it eases pressure points and can be a real difference to the overall user experience.

The Microsoft HTML Help API Commands

How to call a Microsoft HTML Help (.CHM) file programmatically can be a confusing task. There are just so many variables that have to be considered. Do you want the file to open at the default topic or a totally different one? Do you want a specific navigation panel tab to be displayed by default? Do you want the navigation panel displayed at all? Which window is to be used to display the CHM file/topic if it hasn’t been specified in your help file?

If all this seems daunting, there is no cause for worry as all of these questions, and a host full of others, are handled via a series of HTML Help API commands. These enable a Windows program to create a help window that displays a help topic yet maintain complete control over the type, style, and position of it. In addition the HTML Help API commands enable you to provide:

  • Context-sensitive help.
  • Keyword lookups.
  • Interaction between a Windows program and a compiled help (.chm) file.
  • Control over the Navigation pane in the standard HTML Help Viewer.

For a full list of the HTML Help API commands, see the Microsoft Developer Library article. However the most common command opens a .CHM in a particular help window and at a specific help topic. Called HH_DISPLAY_TOPIC the command has the following syntax:

HtmlHelp(
        GetDesktopWindow(),
        "c:\\help.chm::/intro.htm>mainwin",
        HH_DISPLAY_TOPIC,
        NULL) ;

where:

  • c:\\help.chm is the path and name of the CHM file.
  • intro.htm is the file name of the topic to be displayed.
  • mainwin is the name of the window the topic is to be displayed in.

For context sensitive help, the HH_HELP_CONTEXT command is used:

HtmlHelp(
        GetDesktopWindow(),
        "help.chm",
        HH_HELP_CONTEXT,
        5000) ;

where:

  • help.chm is the name of the CHM file.
  • 5000 is the mapid assigned to the topic to be displayed.

Note that is this example no window has been specified in which case the default window is used. If the specified (or default) window is already open, the topic containing the mapid replaces the one currently displayed. If a window is required, just add a greater than symbol and the name of the window after the CHM file topic. For example:

HtmlHelp(
        GetDesktopWindow(),
        "help.chm>mainwin",
        HH_HELP_CONTEXT,
        5000) ;

You can also use the HH_DISPLAY_TOC, HH_DISPLAY_INDEX or HH_DISPLAY_SEARCH commands to display a CHM topic with the Table of Contents, Index or Search tab displayed. If none of these commands are used, the last viewed CHM tab is stored in the user’s HH.DAT file and is used to display the same tab the next time that CHM is opened. As such the HH.DAT file contains details of the last used tab in all the CHMs viewed on the end user’s PC.

The Mk:@MSITStore error

Users of Microsoft HTML Help may occasionally come across the following error message when attempting to open a CHM file:

This can be caused by a couple of issues.

Check your PC

First off is to check that the PC from which the CHM file has been run has all the necessary components installed. Whilst most PCs will start off with everything that is required, they may occasionally have files removed or just suffer from some sort of file corruption. So what do you check for and how? Both of these questions are easily answered thanks to the extremely useful diagnostics utility provided by MJ Plasterer. Just download it, run it and you’ll instantly get a report of the state of your PCs health with specific focus on what is required for HTML Help files.

HHCTRL.OCX File

The error can also indicate a problem with the HHCTRL.OCX file, a Windows file described as the Microsoft HTML Help Control. It is an ActiveX file that enables users to view their help file in the Microsoft Internet Explorer browser. OK so if I don’t use Microsoft IE as my default browser I don’t need this file, right? Wrong! Microsoft HTML Help is a Windows invention therefore they expect you to use their software when viewing it. Users of Microsoft HTML Help (.CHM) files must have Microsoft Internet Explorer installed as it is required to render the help contents. The HHCTRL.OCX file can be found in the SYSTEM32 windows sub directory (e.g. Windows\System32).

So what sort of things can cause problems with the HHCRTL.OCX file? It seems like this file has a hard time competing with all sorts of PC related software. Newly installed hardware drivers and automatic application updates can all cause problems. It can get overwritten with an incompatible version when installing or uninstalling applications.

OK so how can I fix this? With care! If the problem is related to a single CHM, it is worth checking the output path specified in your authoring tool (e.g. the single source layout in RoboHelp). Ensure that the path isn’t too long. If this isn’t the problem, try creating a new output location or a single source layout. If this doesn’t work, you may need to take more remedial action.

  1. Firstly you can try replacing the file with a previous version. Look back at a restore point or your Windows installation disk. Failing that, you can download the file from the internet as there are all sorts of sites offering it free of charge.
  2. Clean up your Windows registry. It is common for some applications to create conflicting base addresses for the User32.DLL (e.g. Realtek HD Audio Control Panel). You can edit your registry by using the REGEDIT command from the run menu item or alternatively use one of the many registry clean up applications (some even freeware) available for download online. Beware however that changing the registry can have a sever effect on how it operates if you do not know what you are doing.
  3. Restore your user profile. I have heard of instances where the profile has become corrupted.

Note: The HHCTRL.OCX, registry and user profiles are important operating system files and no attempt must be made to fix them without first taking a backup and secondly knowing what you are doing. If in doubt, don’t do it as you are likely to open up a can of worms if you get things wrong.

The HH.DAT file

Users of Microsoft HTML Help as their output type may not know it but there is a windows file lurking under the covers of their operating system that has a lot of control over the CHM’s use. The file, HH.DAT, is a data file used by the HTML Help Viewer used to display each and every CHM file. The file is automatically updated every time a CHM file opened and therefore the HTML Help Viewer is used. If the file does not exist, it is created.

The HH.DAT file is a user specific data file that holds all sorts of information about use of CHM files on a PC. For example:

  • Favourites: If a favorite tab is used inside a CHM, the favorite topics added by the user are recorded.
  • Last visited tab: When a CHM file is compiled, you can define the default tab displayed when the file is opened. If a user opened one of the other tabs (e.g. the index) and closes the file, the next time the file is opened, it will be opened in the Index tab.
  • Window position: If the CHM file window has been moved from its original position, the new location is recorded. That said, if the CHM is opened programmatically (i.e. from an application) the help call can open the CHM at a precise position regardless of what is in the HH.DAT file.

The file also contains details of the user’s search history, the position of the CHM file window as well lots of other stuff. It is located in a directory according to your Windows operating system. For example:

Windows OS

Location

XP

C:\Documents and Settings\User\Application Data\Microsoft\HTML
Help (where user is the username)

98 / 95 / Millenium (ME)

C:\Windows

2000 / NT

C:\WinNt

You will be unable to view this file if you are not displaying system files. Additionally, as a user specific file, a copy exists for each user of a PC. Therefore you may find multiple copies of the file on each PC.

Occasionally, the file can cause an access violation occurs when trying to view a CHM file. This signifies a corrupt HH.DAT file. As the file is created if it is not present, the solution is to delete the file. It is also good practice to delete the file when updating the HTML Help viewer (Hhupd.exe). Deleting the file will lose all the user settings (e.g. favorites, last visited tab).

Note: Looking at the file contents requires an application capable of doing so. Helpware’s FAR is a useful utility capable of doing so as also allows you to check CHM file links and API help calls.