I have a Delphi console application that at the end needs to launch one of two applications.
I'm having some problems getting ShellExecute to work without erroring, and I think the problem is associated with not having a handle for the console applicaiton.
The line that is causing me grief is:
ShellExecute(0, 'open', 'someapplication.exe', nil, nil, SW_SHOWNORMAL);
I think that the 0 in the handle is the problem as it compiles OK and runs in the debugger OK, but if I try to run the executable I get an unhandled error (the console application thinks that it has finished happily).