Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I call my Help file?

Status
Not open for further replies.

delphiman

Programmer
Dec 13, 2001
422
ZA

I have created a help file for a project
which I have called MyHelp.hlp

I have been to Project/Options/Application where
I have browsed and found MyHelp.hlp

But now how do I call it in this procedure.

procedure TfrmBallot.BitBtn1Click(Sender: TObject);
begin

?????

end;

Anyone?
 
hi,

procedure TfrmBallot.BitBtn1Click(Sender: TObject);
begin
Application.helpfile := 'MyHelp.hlp';
end;

Better is to put is in the startup of the program.

To activate you just press F1. But there is something else. In your application you can define the propertie Helpcontext which is a number. This number references a page within your helpfile. This makes it possible to create Context sensitive helpfiles.

Steph [Bigglasses]
 
However, if you want to call your helpfile with a button click as you suggest, after entering the helpfiles name using Application.Helpfile := C:\MyHelp.hlp, you can use the following line to open the helpfile on the contents page.

Application.HelpCommand(HELP_FINDER, 0);

Hope this is what you were looking for. Arte Et Labore
 
I'm sorry guys. :)

In fact I have a .html file which am trying to load.

MS-Help having become outdated I switched to creating
.html files which have become more conventional.

But how do I load them from within Delphi?

 
Are you using HTMLHelp to create *.chm files ?
This is the replacement for windows help it compiles .Html files into the .chm file.
Windows has a new help system 'hh.exe' that runs these files.

You can get Delphi to call the windows chm interpreter hh.exe directly, or there is a compont suite (EHS)that integrates for you.

Steve
 
Fixed!! Case closed. :)

For anyone interested in this thread (and using Delphi 6)I have solved this as follows:

1. In Uses of my form I have ShellAPI.

2. I dropped a SaveDialog1 component (from the Dialogs pallet)onto my form and set the Properies as follows.

Ctl3D True
Default Ext HTM
FileName C:\Program Files\MyExeFile\Help.html
Filter HTML file (*.htm)|*.htm|Any file (*.*)|*.*
Filter Index 1
Help Context 0
Name SaveDialog1
In Options I have only the following True

ofOverwritePromp
ofPathMustExist
ofCreatePromp
ofEnablingSize.

3. I have a "Help" button with the following EventHandler

procedure TfrmBallot.btbtnHelpClick(Sender: TObject);
begin
ShellExecute (Handle, 'open', PChar (SaveDialog1.FileName),
'', '', sw_ShowNormal);
end;

Works perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top