Using ShellExecute with hh.exe and parameters (Delphi 3)

I am having problems passing a .CHM file mapID value into a ShellExecute procedure.  Although the .CHM file launches, the context ID (mapID) page does not appear as the default.  Here's the code I'm using...

HelpNullFile: Array[0..128] of Char;
Instance: THandle;

begin

StrPCopy(HelpNullFile, ExtractFilePath(Application.ExeName) + 'help.chm');

Instance := ShellExecute(Application.Handle, 'open', HelpNullFile, PChar('-mapid 5'), nil, SW_SHOWNORMAL      );

end;

If I go to a DOS prompt, and type...

hh.exe -mapID 5 help.chm

... the correct page appears.  How can I get the correct page to appear when launched within Delphi 3?
Monroe406Asked:
Who is Participating?
 
wavgetCommented:
My guess...

ShellExecute(Handle,'open','hh.exe','-mapid 5 c:\dir\help.chm',nil,SW_SHOWNORMAL)
0
 
developmentguruPresidentCommented:
Show me the command line text please.  When I see that I should be able to help.
0
 
Monroe406Author Commented:
>> Show me the command line text please.

I had the command line version in my original message:

hh.exe -mapID 5 help.chm
0
 
Monroe406Author Commented:
'hh.exe' should be PChar('hh.exe')
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.