Following advice already given in this forum I can activate a chm help file from within a running Lazarus application using the following code :
procedure TForm1.Contents1Click(Sender: TObject);
{Menu item Help | Contents displays the table of contents of the help file}
begin
{call the procedure which launches the help file}
LaunchCHMHelp('HelpFileName.chm');
end;
procedure TForm1.LaunchCHMHelp(ProgramName: string);
{launches the help file}
var
AProcess: TProcess;
begin
try
AProcess := TProcess.Create(nil);
AProcess.CommandLine := 'hh.exe' + ' ' +
ExtractFilePath(Application.ExeName) + ProgramName;
AProcess.Execute;
AProcess.Free;
except
MessageDlg('Problem encountered with Help file',mtError,[mbOK],0);
end;
end;
But is there an easy way to extend the code so as to allow context sensitive calls to the help file?