Help
From: "Jarle Stabell" <jarle.stabel@dokpro.uio.no>
Using HELP_FINDER works if the "current tab" is not the 'Index' or 'Find' tab. HELP_FINDER opens the Help Topics window, but doesn't change tab to the Contents tab if current tab is 'Index' or 'Find'.Try this code:
Function L1InvokeHelpMacro(const i_strMacro: String; const i_bForceFile: Boolean): Boolean; Begin if i_bForceFile then Application.HelpCommand(HELP_FORCEFILE, 0); Result:=Application.HelpCommand(HELP_COMMAND, Longint(PChar(i_strMacro))); //The PChar cast not strictly necessary. End;Forces the associated help file to (be) open, and shows the 'Index' tab:
L1InvokeHelpMacro('Search()', True);Forces the associated help file to (be) open, and shows the 'Contents' tab:
L1InvokeHelpMacro('Contents()', True);Forces the associated help file to (be) open, and shows the 'Find' tab (WinHelp 4 only):
L1InvokeHelpMacro('Find()', True);
Here's how I do it.
procedure TForm1.btnHelpClick(Sender: TObject); begin Application.HelpContext(TButton(Sender).HelpContext); end;That's it!
You can also call other Application methods to invoke the help file such as Application.HelpCommand and Application.HelpJump.