Discussion:
Winhelp process is started every time F1 is pressed
(too old to reply)
v***@nlr.nl
2007-09-19 14:26:33 UTC
Permalink
Raw Message
I have a Delphi2006 application using WinHelpViewer and performing the
following code when the menu item Help contents is selected, or F1 is
pressed.

procedure TForm_Main.SubMenu_ContentsClick(Sender: TObject);
begin
Application.HelpFile := ExtractFilePath(Application.ExeName)
+'MyHelp.hlp';
Application.HelpCommand(HELP_FINDER, 0);
end;

Every time the user does this, a new winhlp32.exe process is started.
So after some time the machine slows down with many winhlp32.exe
processes running and consuming the CPU.

I have tried to add a statement before the current line
with ...HelpCommand...:
Application.HelpCommand(HELP_QUIT,0);
to force the running winhlp32.exe to stop before the next starts, but
this does not work.

Any suggestions, please?
P***@gmail.com
2007-10-25 10:56:46 UTC
Permalink
Raw Message
Post by v***@nlr.nl
I have a Delphi2006 application using WinHelpViewer and performing the
following code when the menu item Help contents is selected, or F1 is
pressed.
procedure TForm_Main.SubMenu_ContentsClick(Sender: TObject);
begin
Application.HelpFile := ExtractFilePath(Application.ExeName)
+'MyHelp.hlp';
Application.HelpCommand(HELP_FINDER, 0);
end;
Every time the user does this, a new winhlp32.exe process is started.
So after some time the machine slows down with many winhlp32.exe
processes running and consuming the CPU.
I have tried to add a statement before the current line
Application.HelpCommand(HELP_QUIT,0);
to force the running winhlp32.exe to stop before the next starts, but
this does not work.
Any suggestions, please?
HI

I am sure... the Application.HelpFile :=
ExtractFilePath(Application.ExeName)+'MyHelp.hlp';
should only be called once...
I call it in the .Dpr
you then only call the Application.HelpCommand(HELP_FINDER, 0);
with a different index... to go to the right page.

and then the Application.HelpCommand(HELP_QUIT, 0);
when you close your application.

hope this helps

Loading...