HH_DISPLAY_TOC

Selects the Table Of Contents (TOC) tab.

Argument Description
hwndCaller Handle of the owner window or 0
pszFile HTML Help URL: Compiled help (.chm) file [::/Topic]
uCommand HH_DISPLAY_TOC
dwData nil or the URL of a topic within the helpfile

Return value:
This command always returns the handle of the helpwindow that was displayed. If the specified topic couldn't be found HTML Help opens the compiled help (.chm) file and displays a generic "The page cannot be displayed" topic. The return value is only 0 when the specified helpfile itself could not be found.

Description:
The HH_DISPLAY_TOC command selects the Table Of Contents (TOC) tab of the HTML Help viewer's navigation pane. Optionally it selects and displays a topic within the helpfile. If needed the helpfile is opened first. Note that in order to select a specific topic you must make sure that the helpfile is closed first (sometimes it works without closing, usually is does not). The topic does not necessarily has to exist in the TOC to be displayed using this command, it goes without saying that it must be compiled into the help file though.

Example:

To select the TOC

HtmlHelp(0, PChar('JediHtmlHelp.chm'), HH_DISPLAY_TOC, 0);

To select the TOC and a specific topic

HtmlHelp(0, nil, HH_CLOSE_ALL, 0);
HtmlHelp(0, PChar('JediHtmlHelp.chm::/HTML\Api Reference\Commands\HH_DISPLAY_TOC.htm'), HH_DISPLAY_TOC, 0);

Notes:
The HTML Help API reference states that you can use the dwData to specify the topic to display as in the following code snippet:

HtmlHelp(0, PChar('JediHtmlHelp.chm'), HH_DISPLAY_TOPIC, DWORD(PChar('HTML\Api Reference\Commands\HH_DISPLAY_TOPIC.htm')));

However, I could not get this to work.

See also:
HH_DISPLAY_SEARCH
HH_DISPLAY_INDEX