The |SYSTEM internal file says which compiler made the help file, how the
text is stored, and what the file is called. A reader must parse it first.
Header
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | Magic | Always 0x036C |
| 2 | 2 | u16 | Minor | The version; see Versions |
| 4 | 2 | u16 | Major | Always 1 |
| 6 | 4 | u32 | GenDate | When the file was compiled, in seconds since 1 January 1970 (UTC), or 0 |
| 10 | 2 | u16 | Flags | How the topics are stored, for Minor above 16; see below |
Compression flags
For Minor 16 and below the flags field is not used: topics are uncompressed, in 2,048-byte blocks, and the field can hold anything.
| Flags | Topic compression | Block size |
|---|---|---|
| 0 | None | 4,096 bytes |
| 4 | LZ77 | 4,096 bytes |
| 8 | LZ77 | 2,048 bytes |
What follows the header
For Minor 16 and below: one NUL-terminated string, the help file’s title.
For Minor above 16: records until the end of the file, each with this header and then its data.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | RecordType | What the record is; see the table below |
| 2 | 2 | u16 | DataSize | The number of bytes of data |
| Type | Name | Data |
|---|---|---|
| 1 | Title | NUL-terminated string |
| 2 | Copyright | NUL-terminated string, shown in the About box |
| 3 | Contents topic | The topic offset of the topic shown first (4 bytes) |
| 4 | Macro | A macro that runs when the file opens, as a NUL-terminated string |
| 5 | Icon | An icon, in the .ico file format |
| 6 | Window | A window definition; see below |
| 8 | Citation | Text added when text is copied, as a NUL-terminated string |
| 9 | Language | Windows 95 and later: four 16-bit language numbers |
| 10 | Contents file | The name of the .cnt contents file |
| 11 | Character set | A 16-bit Windows character set number |
| 12 | Default font | A byte for the height in points, a byte for the character set and the font name as a NUL-terminated string |
| 13–15 | Index settings | Used for full-text indexes and keyword index separators; Multimedia Viewer files use these numbers differently |
| 18 | Language name | A NUL-terminated string |
| 19 | Extension libraries | Four NUL-terminated strings: the names of 16-bit and 32-bit DLLs, each retail and debug |
Window record
Each window defined in the help project is a 90-byte record. A flag bit says which fields hold real values.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | Flags | Bits, low first: Type, Name, Caption, X, Y, Width, Height, Maximize, Colour, Non-scrolling colour, Always on top, Auto-size height |
| 2 | 10 | char | Type | The window type |
| 12 | 9 | char | Name | The name jumps use |
| 21 | 51 | char | Caption | The window title |
| 72 | 2 | i16 | X | Left edge, 0 to 1,000 |
| 74 | 2 | i16 | Y | Top edge, 0 to 1,000 |
| 76 | 2 | i16 | Width | 0 to 1,000 |
| 78 | 2 | i16 | Height | 0 to 1,000 |
| 80 | 2 | i16 | Maximize | Maximise flag and window styles |
| 82 | 4 | u32 | Rgb | Background colour of the scrolling area (Windows COLORREF) |
| 86 | 4 | u32 | RgbNsr | Background colour of the non-scrolling area |