Solved

How to show a help file

Posted on 1999-01-16
9
145 Views
Last Modified: 2010-04-06
Hi again.... I have a help file called MONITOR.HLP. I wrote this name in the form property HelpFile. The question is, how can I show it?

Thanks in advance
Skel
0
Comment
Question by:skel
9 Comments
 
LVL 10

Accepted Solution

by:
viktornet earned 50 total points
ID: 1362224
The usual way is this...

Go to the Form's properties and do this...

Set HelpFile to the name of the help file...

Form.HelpFile := 'MONITOR.HLP';

then you should set the HelpContext to 1 or another number that is different than 0...

If all this doesn't work just do this...

ShellExecute(0, 'open', 'MONITOR.HLP', nil, nil, SH_SHOWNORMAL);

That's all :)

-Viktor
--Ivanov
0
 
LVL 17

Expert Comment

by:inthe
ID: 1362225
hi skel,
well you can either call it off a menu item like so:
 
ShellExecute(Handle, Open,'pathtoyour\monitor.hlp' , NIL, NIL, sw_ShowNormal);

or you can use the context sensitive help, below is taken from delphi help using context help number in delphi's object inspector:

HelpContext displays the help file for an application.
type THelpContext = -MaxLongInt..MaxLongInt;
function HelpContext(Context: THelpContext): Boolean;

Description

Use HelpContext to bring up the help file for the application specified in the HelpFile property. HelpContext calls OnHelp directly.
HelpContext passes the file name contained in HelpFile and the context number passed in Context parameter. For example, if the Context value is 714, the HelpContext method displays the screen with the context help ID of 714 in the Help file.
HelpContext returns False if HelpFile is an empty string, meaning the application has no Help file assigned. In all other cases, HelpContext returns True.

This example uses a bitmap button on a form. When the user clicks the button, the screen with the context number of 714 in the DATA.HLP Help file appears.  Note that using constants for HelpContext numbers makes the code easier to read:

const

  DATANOTFOUND = 714;

procedure TForm1.BitBtn1Click(Sender: TObject);

begin
  Application.HelpFile := 'DATA.HLP';
  Application.HelpContext(DATANOTFOUND);
end;

also for more info look microsoft help workshop in delphi's help/tools directory to assigning topic-id's and designing conext help files.
hope this is of some help <--- :-)
Regards Barry
0
 
LVL 17

Expert Comment

by:inthe
ID: 1362226
hi viktor
 i new i should have refreshed before posting

¤   ¤
  ^
\___/
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1362227
Eh, eh, eh.. :)) I was faster than you Barry :)

  ^----^
/  ¤   ¤ \
\     ^    /
  \_V_/
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 17

Expert Comment

by:inthe
ID: 1362228
right ive had enough im off to buy mavis beacon
lol
0
 

Author Comment

by:skel
ID: 1362229
Viktor... I tried both ways... the first shows me the error that Topic not found, but I can open the help file by executing winhelp.exe program

The second way didn't compile.... it says that ShellExecute is an undeclared identify (the same with SW_SHOWNORMAL).

Thanks
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1362230
if you use ShellExecute() you should include ShellAPI to your uses clause...

Why don't you try Application.HelpFile := filepath;
Application.HelpContext := whatever;//Different than zero,,,

The best way is to use ShellExecute()...so...good luck,,,

-Viktor
--Ivanov
0
 
LVL 1

Expert Comment

by:BlackDeath
ID: 1362231
hi, skel.
hi vik, hi inthe.

skel, try:

Application.HelpFile := ExtractFilePath(Application.ExeName) + 'monitor.hlp';
Application.HelpJump('MonitorContents'); //with MonitorContents being the context string for your context page

Black Death.

0
 

Expert Comment

by:mrpipe
ID: 1362232
Use...

Application.HelpFile := HELPFILE;
Application.HelpCommand(HELP_FINDER, 0);

it's easier...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now