Solved

How to show a help file

Posted on 1999-01-16
9
150 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

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