According to the manual, $WINHELP's "HELP-CONTENTS" opcode will have the runtime display the help file's contents. However, the following code fails to display the help file's contents, instead it displays the help file's first page.
call "$WINHELP" using "APHELP.HLP", help-contents.
The correct behavior can be demonstrated by double-clicking on the HLP file directly.
The following code will result in the desired behavior:
call "$WINHELP" using "APHELP.HLP", 11.
The information provided in the manual was correct for earlier Windows systems prior to XP, but the newer help system API now uses a different op-code and will be updated in a future version.
A list of the constant values for the Microsoft "WinHelp" library routine which is called from "$WINHELP" at the URL below.
These two excepts from the list of constant values from the above-named site indicate that HELP_CONTENTS (3) is no longer the "preferred" value to display the help contents screen.
HELP_CONTENTS (3 or 0x0003) displays the topic specified by the Contents option in the [OPTIONS] section of the .HPJ file. This command is for backward compatibility. New applications should provide a .CNT file and use the HELP_FINDER command. dwData is ignored. Set it to 0.
HELP_FINDER (11 or 0x000B) displays the Help Topics dialog box with the last tab used. dwData is
ignored. Set it to 0.
The URL and note below are from the Microsoft Knowledge Base and provide some additional information.
NOTE: The Help Constants topic of the Visual Basic Help file has additional values for the third parameter (command parameter). HELP_CONTENTS is still kept in WinHelp for backward compatibility with 16-bit Help files. The HELP_FINDER command is preferred for 32-bit Help files.