|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi all!
I wrote a small application in Delphi 4, that uses ShellExecuteA of Shell32.dll to launch another application. It works perfectly in Win 95, 98 and ME, but fails in Win2000. Error message reports that shell32.dll can not be found, though shell32.dll IS located at the System32 directory mentioned in the error message. Apparently ShellExecuteA doesn't work in Win2000 for some reason? Anyone any ideas? Other functions I could use? Here's how I have defined the function call: Code:
uses function ShellExecute(hWnd: HWND; Operation, FileName, Parameters, Directory: PChar; ShowCmd: Integer): HINST; stdcall; implements function ShellExecute; external 'shell32' name 'ShellExecuteA'; Actual call: ShellExecute(handle, 'open', Pchar(ExePath) , nil, nil, SW_SHOWNORMAL); I derive a part of the ExePath path by ExtractFilePath(ParamStr(0)). Could it be that ExtractFilePath(ParamStr(0)) fails in Win2000? |
|
#2
|
||||
|
||||
|
Sounds like you've come from a VB background. In the first place, a NT class system has ShellExecuteW since it is widechar capable. Also, why bother to prototype the exact call, when Delphi has a perfectly working version of the same.
Code:
uses
ShellApi;
Actual call:
ShellExecute(handle, 'open', ExePath , nil, nil, SW_SHOWNORMAL);
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by Keath and KevinADC, superior perl programmers of the month |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Delphi Programming > ShellExecuteA or ExtractFilePath(ParamStr(0)) fails in Win2000? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|