ShellExecute()

Started by
2 comments, last by Chaucer 20 years, 1 month ago
The windows api has a ShellExecute() function. Is there a way to determine if the program called by ShellExecute() is finished? thanks
Thanks!
Advertisement
Try this. Scroll down about halfway.


EDIT: sorry, that only works with CreateProcess. I don't think you can do this with ShellExecute because the only thing you get back from the function is a success\error code. You would have to do something hacky like calling FindWindow and seeing if the window for the application you launched still exists.


[edited by - CodeMunkie on March 18, 2004 1:43:03 PM]
"When you die, if you get a choice between going to regular heaven or pie heaven, choose pie heaven. It might be a trick, but if it's not, mmmmmmm, boy."
How to Ask Questions the Smart Way.
Try using ShellExecuteEx() instead. The hProcess member of the structure after the function call should contain a handle that you can wait on (if the result of the call results in an actual process being starting).
Thank you. I really appreciate your post. It looks like I can use CreateProcess() instead of ShellExecute().
Thanks!

This topic is closed to new replies.

Advertisement