Hooking Help Problem


2003-07-15 03:29:35 PM
cppbuilder109
There is a file in example 12 ,"D60OnHelpGix.pas". When this file included
the OnHelp problem not occurs. There is an extended explanation in file.
www.helpware.net/downloads/example12.zip
www.helpware.net/downloads/hhcode_and_exe%20BCB.zip
www.helpware.net/
www.helpware.net/delphi/
Before D6, if we wanted to get a non-WinHelp Help system working for a
Delphi
application, we simply took over the Form.OnHelp or Application.OnHelp
event(s).
Our OnHelp code would typically divert WinHelp calls off to another API,
such
as MS HTML Help or MS Help 2.
There is a bug in Delphi 6 where the Form.OnHelp and Application.OnHelp
events do not work as they did in D2/3/4/5. You can still hook OnHelp
however only F1 help events and the Application.HelpCommand() calls
work. And only if the current forms (biHelp in BorderIcons) property is
set.
This module fixes this problem by making sure all help events are
diverted to Application.OnHelp like it was in previous versions of Delphi.
Simply include this Unit in your project, and OnHelp will fire correctly.
ABout the D6 OnHelp bug:
Delphi6 does not pass on all help calls to the OnHelp event.
Infact if you search for WMHelp code in Forms.pas you will see that
only Application.InvokeHelp() handles FOnHelp. And that it only works
if the (biHelp in BorderIcons) property is true.
Application.HelpCommand() is ok as it calls InvokeHelp(). But all other
help
calls bypass InvokeHelp() and call the D6 Help Manager directly.
EG. Application.HelpContext(), Application.HelpJump().
The provided D6OnHelpFix.pas module implements a second help viewer which
catches all lost help calls and passes them onto OnHelp.
--
___________________________________
Eyyub Volkan Çektimur
Proya Software & Trade Inc.
Head of Core Development Department