?
Solved

Displaying HelpOnHelp in XP?

Posted on 2005-04-05
5
Medium Priority
?
286 Views
Last Modified: 2010-04-16
Has HelpOnHelp been discontinued in XP?  The following code works fine in 98 but not XP:

  Application.HelpCommand(HELP_HELPONHELP, 0);

Chris Bray.
0
Comment
Question by:chrisbray
[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
  • 3
5 Comments
 
LVL 11

Expert Comment

by:shaneholmes
ID: 13708704
is the HelpContext property on the main form set to  something other than 0 ?

sholmes
0
 
LVL 3

Author Comment

by:chrisbray
ID: 13709050
Hi Shane,

No.  But that shouldn't matter anyway - HELP_HELPONHELP is defined in Windows.pas as an external API call to the Windows help system and should display the 'how to use help' help file.

I suspect that it has been moved or discontinued under Win XP and therefore the call is simply ignored.

Chris Bray.
0
 
LVL 13

Accepted Solution

by:
BlackTigerX earned 200 total points
ID: 13712965
you're right...
http://www.elists.org/pipermail/delphi/2002-August/021317.html

procedure TForm1.ShowHelpOnHelp;
var OldHelp: string;
begin
OldHelp := Application.HelpFile;
if OSIsWinXP then begin
  Application.HelpFile := GetSystem32Path+'\winhelp.hlp';
  Application.HelpCommand (HELP_CONTENTS, 0);
  end
else begin
  Application.HelpFile := 'winhlp32.hlp';
  Application.HelpCommand (HELP_HELPONHELP, 0);
  end;
Application.HelpFile := OldHelp;
end;
0
 
LVL 3

Author Comment

by:chrisbray
ID: 13714833
Hi BlackTigerX,

Thank you for that information.  There are a couple of minor problems with what you provided, but it certainly pointed me in the right direction so you get the points...

Problems arise when used in conjunction with THTMLHelpRouter, and MS state that the minor version for XP is 1 although it does indeed seem to return the correct value - odd that one.  According to MS the OSIsWinXP function as written should return False since 0 should match with Win2k...

Anyway, all my problems were resolved as follows:

procedure TMainForm.HowtoUseHelp1Click(Sender: TObject);
var
  OldHelp: string;
begin
  OldHelp := Application.HelpFile;
  if OSIsWinXP then
    begin
      ShellExecute(Handle,'open',PChar(GetSystem32Path+'\winhelp.hlp'), nil,nil,SW_SHOWNORMAL);
    end
  else
    begin
      Application.HelpFile := 'winhlp32.hlp';
      Application.HelpCommand (HELP_HELPONHELP, 0);
      Application.HelpFile := OldHelp;
    end;
end;
0
 
LVL 3

Author Comment

by:chrisbray
ID: 13715040
Quick code correction:

procedure TMainForm.HowtoUseHelp1Click(Sender: TObject);
var
  OldHelp: string;
begin
  if OSIsWinXP then
    begin
      ShellExecute(Handle,'open',PChar(GetSystem32Path+'\winhelp.hlp'), nil,nil,SW_SHOWNORMAL);
    end
  else
    begin
      OldHelp := Application.HelpFile;
      Application.HelpFile := 'winhlp32.hlp';
      Application.HelpCommand (HELP_HELPONHELP, 0);
      Application.HelpFile := OldHelp;
    end;
end;
0

Featured Post

Industry Leaders: 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!

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…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month8 days, 1 hour left to enroll

765 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