Tip for HtmlHelp HH_DISPLAY_TOPIC call with anchor

This section is for programmers. Please use it for all discussons on interfacing help with your applications and related subjects.

Moderators: Alexander Halser, Michael Schwarzl

Post Reply
Jeff K
Posts: 18
Joined: Thu Mar 04, 2010 12:57 am

Tip for HtmlHelp HH_DISPLAY_TOPIC call with anchor

Unread post by Jeff K »

Here is a tip for using the HTML Help API HtmlHelp function with the HH_DISPLAY_TOPIC command when an anchor is included.

Syntax:
HWND hwnd =
HtmlHelp(
GetDesktopWindow(),
"c:\\help.chm::/topic1.htm#anchor1",
HH_DISPLAY_TOPIC,
NULL) ;

Where:
topic1 = topicID
anchor1 = anchor within topic1

Tip:
The "/" before the topicID ('topic1' in this example) is needed. Without it, a call with an anchor will open the topic and anchor properly, but the table of contents will not be opened to the proper topic.
Post Reply