Solved

How to show a help file

Posted on 1999-01-16
9
143 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

707 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

19 Experts available now in Live!

Get 1:1 Help Now