Does anyone know how to get the Application.OnHelp event to fire in Delphi7?
My code currently looks like this:
procedure TfrmGui.FormCreate(Sender: TObject);
begin
sAppDir:=Extractfilepath(Application.Exename);
Application.Helpfile:=sAppDir+'Help.chm';
Application.OnHelp:=FormHelp;
end;
function TfrmGui.FormHelp(Command: Word; Data: Integer; var CallHelp:
Boolean): Boolean;
var sBase:string;
begin
sBase:='mk:@MSITStore:'+sAppDir+'Help.chm'+::/Help Pages/';
Execute('hh.exe',sBase+'test topic.htm',sw_shownormal);
CallHelp:=false;
end;
Premise: Delphi supports .hlp help, but not .chm help - so I'm intercepting
the help event and calling HTML Help manually.
My Execute function is just a wrapper for ShellExecute. The application
controls have a HelpKeyword assigned in the Object Inspector, and the
HelpType property is set to htKeyword.
Eventually I hope to replace 'test topic.htm' with the htKeyword value
obtained through the passed Data variable. At least I think I read
somewhere that 'Data' can hold a pointer to the htKeyword string. Would be
really nice if OnHelp passed htKeyword as a string, or the object e.g.
Sender: TObject instead.
But at the moment I can't even get the OnHelp routine to fire in response to
F1 on the keyboard. Anyone help?
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.554 / Virus Database: 346 - Release Date: 20/12/2003
> But at the moment I can't even get the OnHelp routine to fire in
> response to F1 on the keyboard. Anyone help?
Did you set the Help* properties of the test control?
--
Cheers,
Ignacio
Help improve Delphi: http://qc.borland.com/
HelpKeyword | Test
HelpType | htKeyword
Is that what you meant - or do I need to set something else too?
----
"Ignacio Vazquez" <ivazquezATorioncommunications.com> wrote in message
news:4008...@newsgroups.borland.com...
> Is that what you meant - or do I need to set something else too?
No, that's exactly what I meant.
That part's fine, so hmm...
Do you have a handler assigned to TForm.OnHelp?
> Does anyone know how to get the Application.OnHelp event to fire in
Delphi7?
> My code currently looks like this:
>
> procedure TfrmGui.FormCreate(Sender: TObject);
> begin
> sAppDir:=Extractfilepath(Application.Exename);
> Application.Helpfile:=sAppDir+'Help.chm';
> Application.OnHelp:=FormHelp;
> end;
>
> function TfrmGui.FormHelp(Command: Word; Data: Integer; var CallHelp:
> Boolean): Boolean;
> var sBase:string;
> begin
> sBase:='mk:@MSITStore:'+sAppDir+'Help.chm'+::/Help Pages/';
> Execute('hh.exe',sBase+'test topic.htm',sw_shownormal);
> CallHelp:=false;
> end;
>
> Premise: Delphi supports .hlp help, but not .chm help - so I'm
intercepting
> the help event and calling HTML Help manually.
I believe you need a fix for this.
I've posted it to the borland.public.attachments group.
I cannot remember where I got it, but I'm pretty sure it's freeware.
--
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
---
"Martijn Tonies" <m.tonies@upscene!nospam!.com> wrote in message
news:40083d43$1...@newsgroups.borland.com...
>
> I believe you need a fix for this.
>
> I've posted it to the borland.public.attachments group.
>
> I cannot remember where I got it, but I'm pretty sure it's freeware.
>
>
> --
> With regards,
>
> Martijn Tonies
> Database Workbench - developer tool for InterBase, Firebird, MySQL & MS
SQL
> Server.
> Upscene Productions
> http://www.upscene.com
>
>