Mirror

How to open a help file showing the Index, Contents or Find tab (Views: 100)


Problem/Question/Abstract:

How to open a help file showing the Index, Contents or Find tab

Answer:

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);

<< Back to main page