Archived

This topic is now archived and is closed to further replies.

Chaucer

ShellExecute()

Recommended Posts

The windows api has a ShellExecute() function. Is there a way to determine if the program called by ShellExecute() is finished? thanks

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites