Re: HTML Help
- From: "Alexander Halser" <alexander.REMOVETHIS.halser@xxxxxxx>
- Date: Wed, 22 Nov 2006 00:42:51 +0100
The reason for the stay-on-top mode is the window handle that you use in the
help call as the first parameter. You could set the handle to 0 to disable the
stay-on-top. But not so with training card help... this explicitely requires a
handle to send the WM_TCARD messages to.
A solution would be to create an independent window handle in your application
that can receive the message but does not have a window. This makes the help
window independent from your application window or form while your app still
receives the training card messages.
You need a THandle in your form that is manually allocated when the form is
created and released when the form closes. The handle must be available all
the time the help file is (or could be) open. This could basically look like
this:
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure TrainincCardProc(var Message: TMessage);
private
public
TrainingCardHandle: THandle;
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
TrainingCardHandle := AllocateHwnd(TrainingCardProc);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
DeallocateHwnd(TrainingCardHandle);
end;
procedure TForm1.TrainingCardProc(var Message: TMessage);
begin
if Message.msg = WM_TCARD then
begin
//do something here
end;
end;
--
To display the help file, you use TrainingCardHandle as the first parameter in
_all_ help calls:
HtmlHelp(TrainingCardHandle, pchar(myhelpfile + '::/mytopic.html'),
HH_DISPLAY_TOPIC, 0);
Training card messages should arrive in TForm1.TrainingCardProc.
Good luck!
--
Alexander Halser
_________________________________________
EC Software GmbH - http://www.ec-software.com
Publishers of Help & Manual + TNT Screen Capture
"Tom de Neef" <tdeneef@xxxxxxxx> wrote in message
news:4563254e$0$324$e4fe514c@xxxxxxxxxxxxxxxxx
I've finally got to the help part of my app and want to make it first class.
I want to use HTML Help API, using HTML Help Workshop for the organization
and Frontpage for the authoring. Three very useful units from Robert
Chandler provide Delphi integration. This works very well and the results
look professional. Getting Training Cards to work was trivial.
However... a problem arises when combining HTML Help with modal forms. When
the Help window is open (in stay on top mode) and you open a modal form in
the app, Delphi gets confused. The modal form disappears behind the main
form and from that moment onwards you're stuck. The problem was reported by
Chandler in 2001 and his recommendation is to close Help before opening a
modal form. But that is not really an option when you extend help to
training cards - where the app receives messages from the help system and
responds to that.
I was wondering if embedding the HTML Help window in a delphi form would get
around this issue. Or maybe somebody has solved this problem in another way.
Tom
.
- Follow-Ups:
- Re: HTML Help
- From: Tom de Neef
- Re: HTML Help
- References:
- HTML Help
- From: Tom de Neef
- HTML Help
- Prev by Date: Re: Runtime error 216
- Next by Date: Re: HTML Help
- Previous by thread: HTML Help
- Next by thread: Re: HTML Help
- Index(es):
Relevant Pages
|