Solved

How to show a help file

Posted on 1999-01-16
9
146 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
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
LVL 10

Expert Comment

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

  ^----^
/  ¤   ¤ \
\     ^    /
  \_V_/
0
 
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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 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