Is there a way of forcing the CHM file to open on a specific tab? It remembers what tab you were on and so when you close it while on the Index Tab, then try to show a context page, the context page opens but the tab is still on the Index page. I'd like to force open it on the contents tab with my context highlighted.
Alan
CHM TABs Search, TOC etc
Moderators: Alexander Halser, Tim Green
- Alexander Halser
- EC-Software Support
- Posts: 4106
- Joined: Mon Jun 24, 2002 7:24 pm
- Location: Salzburg, Austria
- Contact:
Re: CHM TABs Search, TOC etc
Yes, there is. When you open the help of Help+Manual (click on the Help button in a dialog box, as this opens a context-sensitive help page) you will notice that the help window always switches back to the TOC tab. The synchronization between topic and TOC is done automatically by the CHM viewer, but the tab switching is done by Help+Manual in the internal help call.Is there a way of forcing the CHM file to open on a specific tab?
For general help display we use this help call:
Code: Select all
HtmlHelp(0, strHelpFile, HH_DISPLAY_TOC, 0);
Code: Select all
HtmlHelp(0, strHelpFile, HH_DISPLAY_TOC, 0);
HtmlHelp(0, strHelpFile, HH_HELP_CONTEXT, intContextMapNumber);
Code: Select all
HtmlHelp(0, strHelpFile, HH_DISPLAY_TOC, 0); //open help and switch to TOC
HtmlHelp(0, strHelpFile, HH_DISPLAY_INDEX, 0); //switch to keyword index
HtmlHelp(0, strHelpFile, HH_DISPLAY_SEARCH, 0); //switch to search tab
Alexander Halser
Senior Software Architect, EC Software GmbH
Senior Software Architect, EC Software GmbH
Re: CHM TABs Search, TOC etc
Thanks Alexander. I seem to have used
Application.HelpSystem.ShowContextHelp
and
Application.HelpCommand
Application.HelpSystem.ShowContextHelp
and
Application.HelpCommand
- Alexander Halser
- EC-Software Support
- Posts: 4106
- Joined: Mon Jun 24, 2002 7:24 pm
- Location: Salzburg, Austria
- Contact:
Re: CHM TABs Search, TOC etc
If it is Delphi and you are using Vcl.HtmlHelpViewer to invoke HTML Help, you need to do it differently.
The unit Vcl.HtmlHelpViewer encapsulates the HtmlHelp() Windows API and you cannot use the Windows API call directly. If you do, especially if you call it with the first paramater "0" (zero, that's the window handle), it will very likely generate an AV. You need to use the same handle in the HtmlHelp() call that the VCL has used to initialize the API. But you cannot easily get to this handle.
The workaround is to let Delphi handle all the application help calls and strictly use Application.HelpCommand().
Example:
The unit Vcl.HtmlHelpViewer encapsulates the HtmlHelp() Windows API and you cannot use the Windows API call directly. If you do, especially if you call it with the first paramater "0" (zero, that's the window handle), it will very likely generate an AV. You need to use the same handle in the HtmlHelp() call that the VCL has used to initialize the API. But you cannot easily get to this handle.
The workaround is to let Delphi handle all the application help calls and strictly use Application.HelpCommand().
Example:
Code: Select all
Application.HelpCommand(HELP_FINDER, 0); //opens the help file and shows TOC
Application.HelpCommand(HELP_CONTEXT, intContextNumber);
//Instead of HELP_CONTEXT you can alternatively use:
//Application.HelpSystem.ShowContextHelp()
Alexander Halser
Senior Software Architect, EC Software GmbH
Senior Software Architect, EC Software GmbH
Re: CHM TABs Search, TOC etc
So in Delphi 7 which doesn't have HTMLHelpViewer, what is the way to force the search tab to open?
HELP_PARTIALKEY brings up the Index Tab
HELP_FINDER and HELP_CONTENTS both bring up the TOC
HELP_HELPONHELP does nothing
HELP_CONTEXT works OK but (brings up teh conxt topic but doesn;t switch back to TOC
I'd like to force the search tab
and also force the switch back to TOC when opening a context ID
Alan
HELP_PARTIALKEY brings up the Index Tab
HELP_FINDER and HELP_CONTENTS both bring up the TOC
HELP_HELPONHELP does nothing
HELP_CONTEXT works OK but (brings up teh conxt topic but doesn;t switch back to TOC
I'd like to force the search tab
and also force the switch back to TOC when opening a context ID
Alan
- Alexander Halser
- EC-Software Support
- Posts: 4106
- Joined: Mon Jun 24, 2002 7:24 pm
- Location: Salzburg, Austria
- Contact:
Re: CHM TABs Search, TOC etc
It should be:what is the way to force the search tab to open?
HH_DISPLAY_TOC (const int = 1) = show TOC tab
HH_DISPLAY_INDEX (const int = 2) = show index tab
HH_DISPLAY_SEARCH (const int = 3) = show search tab
I vaguely remember that the search tab had a few quirks. Looking up an index keyword worked, but looking up a search term through the API never did.
Call HH_DISPLAY_TOC before HELP_CONTEXT. It's 2 help calls in this case.HELP_CONTEXT works OK but (brings up teh conxt topic but doesn;t switch back to TOC
Alexander Halser
Senior Software Architect, EC Software GmbH
Senior Software Architect, EC Software GmbH