chm and secondary window

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

chm and secondary window

Unread postby pl labrie » Fri Sep 27, 2019 12:01 am

I created a chm file with two windows and I would like to know how to open a topic with a secondary window. I use ShowHelp with

thanks for the help
pl labrie
Posts: 24
Joined: Sun Jun 22, 2014 5:11 pm

Re: chm and secondary window

Unread postby Alexander Halser » Fri Sep 27, 2019 11:04 pm

I would like to know how to open a topic with a secondary window. I use ShowHelp with

I am not absolutely sure which parameters ShowHelp in VB takes. If you can specify a topic page in the form "mytopicname.htm" (with the explicit extension .htm), it should work by adding a ">" and the name of the secondary help window.

The raw HTML Help API has 4 parameters:

HtmlHelp(aHandle, aCommandString, aCommand, aData);

aHandle = the window handle of the calling form
aCommandString = the help file name including path and, optionally, the topic to display
aCommand = one of the HTML HELP API commands, for instance: HH_DISPLAY_TOPIC
aData = in most cases zero, for context sensitive calls, it might contain the numeric context ID

Code: Select all
 HtmlHelp(Handle, 'c:\mydata\mychm.chm::thistopic.htm>SecondaryWin', HH_DISPLAY_TOPIC, 0);

So all the important stuff is in the command string. It specifies the CHM file name including path, followed by a double colon "::" followed by the topic page name (the topic ID in H&M plus ".html" or ".htm"). Optionally, you can add the name of the secondary window here.

The VB ShowHelp command might encapsulate this raw API and hide some detail. If Showhelp takes the full topic page name including .html extension, you can easily add the secondary window to that string. However, if ShowHelp takes only the page name without extension and adds the ".htm" by itself, you are probably out of luck. Try to use the raw HtmlHelp() API command instead.

Please note that you must enable secondary windows in Help+Manual. Make sure that H&M really creates the CHM file with secondary window definitions. By default, it doesn't because those multiple help windows in CHM files are merely a legacy from the past. They are less and less used in help systems.

You do not have the required permissions to view the files attached to this post. This may mean that you can't view them at all, or it may just mean that you need to log into the forum to view them.
Alexander Halser
Senior Software Architect, EC Software GmbH
User avatar
Alexander Halser
EC-Software Support
Posts: 3951
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria

Return to Help & Manual 7 Forum

Who is online

Users browsing this forum: No registered users and 7 guests