Chapter 2. Creating MS Windows Help Files

Chapter 2 contains information about generating MSWindows help files (.HLP), which can be read on any machine with MSWindows.

MSWindows help files are generated using the Microsoft Help Compiler (hc.exe), which can be downloaded free at There are other utilities in that directory that generate help files, notably HCWSETUP.EXE and WHAT6.EXE, which differ mainly in their interface.

The Microsoft Help Compiler needs its input to be in RTF—but not just any kind of RTF. It uses a dialect of RTF that adds some RTF commands, doesn’t support other RTF commands, and changes the meaning of a few more RTF commands. Chapter 2 describes how to write simple RTF to produce a no-frills .HLP file, but does not go into the fancier features of Help-RTF.

Help-RTF Basics

A Help-RTF file starts as basic RTF, but contains a list of topics. A topic consists of paragraphs preceded by a topic definition, and followed by a \page command. Informally, I’ll also refer to topics as screens or topic-screens.

A topic definition is a bunch of lines that give the help compiler some metadata about the screen. Strangely, the \footnote command is used for each part. A topic definition consists minimally of this syntax:

#{\footnote context_string}

in which context_string is a unique string that can be used as this particular topic-screen’s URL. The string must not contain spaces; it should consist of just characters from the set A—Z, ...

Get RTF Pocket Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.