Board index » delphi » Q: After ShellExecute, when closing form which called Shellexecute, how do I close the app executed with that call?

Q: After ShellExecute, when closing form which called Shellexecute, how do I close the app executed with that call?

After my Main application calls ShellExecute which runs another
application.  Is it possible to say ShellClose or something which
would then terminate the other application when my Main application is
closing?

daniel
miass...@win.bright.net

 

Re:Q: After ShellExecute, when closing form which called Shellexecute, how do I close the app executed with that call?


Quote
miass...@win.bright.net wrote:
>After my Main application calls ShellExecute which runs another
>application.  Is it possible to say ShellClose or something which
>would then terminate the other application when my Main application is
>closing?

I don't see any way of doing this using ShellExecute, but if you use
the CreateProcess command to run the secondary application, you can
use the returned handle to detect whether the process is still running
by calling GetExitCodeProcess, or shut it down using ExitProcess or
TerminateProcess.

I hope this is of some use, its all documented in the help files but
if you want a bit of example code please email me.

Iain
-----------------------------------------
Iain Magee
iainma...@enterprise.net
-----------------------------------------

Other Threads