Delphi 7 Help display problem

Posted on 2006-04-21
Medium Priority
Last Modified: 2010-04-05
When I assign a help file and help context to a menu item in my program, the correct help screen is not displayed when F1 is pressed.

It will display the first help item in the help file contents no matter which menu item you were on when you pressed F1.
Also, a small popup box is dispayed on the screen with the title of the correct help item topic name and it appears to be independent of the help screen and must be closed separately.

This only happens when I use a tmainmenu object. In my forms and other places, help works fine. Except there is a significant delay in the display of the help of about 3 to 4 seconds. It is long enough to were you wonder if you pressed the F1 key. This happens with all help calls anywhere in the application.

I have experimented in the Delphi IDE to see if I could get an idea of where the problem was. I found that when you bring up Delphi without any files open at all and press F1 on a pull-down menu. It will displays the help for the main menu item of that group. The pull-down menu is also closed when the help appears.

I have tried other applications (projects) and installed Delphi 7 on other computers, and I get the same results.

I would like to know:

1) how to make help work correctly in a tmainmenu object. Or if I cannot, what other menu object will work correctly.

2) how to make the screen screen come up immediately as it does in other Windows based programs.

Question by:pmacbl

Expert Comment

ID: 16513074
Can I see your code please (to see how you are doing this).
I have an idea, but am unsure as to how you have implemented. (There is more than 1 way)



Author Comment

ID: 16525406
I am simply using the forms helpfile and helpcontext properties and the F1 key to call the help. There is no code involved on my end.

Expert Comment

ID: 16548272
hi pmacbl

I am sorry, I cannot re-produce your described problems.
I have tried numerous ways, and only get it to show the correct help-context id.

Plz post ur form and unit code.

As for the delay with opening the helpfile, I can find no good solution at the moment.

Technology Partners: 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!


Expert Comment

ID: 16647806
Application.HelpFile :=Your Application Path+'\'+'YourHelpFile.hlp';
Application.HelpCommand(HELP_FINDER, 0);

Your help file extension depends on the help you use it can be chm also.

Expert Comment

ID: 16677533

I can't seem to solve the problem of the help file loading slowly, but I seem to have solved your menu problem.

Application.HelpCommand(HELP_FINDER, 0); <-- This is the problem line....

The entire thing works if you take this out...
All my menus goto the correct place in the help file.

Description of problem:
Helpcommand is defined as follows

function HelpCommand(Command: Word; Data: Longint): Boolean;

Now, the Data is where the index your program is looking for in the help file goes, but you have assigned it to zero.
Delphi 7 automatically picks up the helpcontext from the menuitem, if you leave this line out.  Otherwise you may have to determine which item the mouse is over, pick up its helpcontext and pass it into this function.

Hope this fixes your problem...


Author Comment

ID: 16711715
No that did not resolve my problem.

I did find this information that tells me it is possibly a bug in Delphi 6 - 7.


Delphi 6 and above broke the OnHelp event which we rely on to override the Delphi WinHelp system (you will notice the some help events no longer fire). Please make sure you download "Delphi Example 12" which includes a fix file (D6OnHelpFix.pas). All you need to do is include the D6OnHelpFix.pas unit anywhere in your project and all help events will then fire as they did in Delphi 3/4/5.

I did not find anything that addresses the delay of the help displaying.


Accepted Solution

GranMod earned 0 total points
ID: 16981973
PAQed with points refunded (250)

Community Support Moderator

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…

616 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