Sign in to follow this  

Stop the code in one project until closint an exe which is called for the first project

This topic is 2139 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello to all members!
I have a Windows Forms Application project and a Win32Project.
I want from my W.F.Application to press a "button" and call the Win32Project exe.
But I want to [u][b]STOP[/b][/u] the W.F.Application code of running, until the Win32Project exe closed.
How can I do that?
I used the
ShellExecute(NULL,L"open",cstr4,NULL,NULL,SW_SHOWMAXIMIZED)
to call the Win32Project exe.
Any help would be appreciated.

Share this post


Link to post
Share on other sites
If I understand you correctly, you want to let W.F waits until Win32Project exits?
Then you need some more Win API than ShellExecute

See here
http://stackoverflow.com/questions/42531/how-do-i-call-createprocess-in-c-to-launch-a-windows-executable

Share this post


Link to post
Share on other sites
[url="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start%28v=vs.71%29.aspx"]Process.start()[/url], followed by [url="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.waitforexit%28v=vs.71%29.aspx"]Process.WaitForExit()[/url] or similar.

Share this post


Link to post
Share on other sites
[url="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start%28v=vs.71%29.aspx"]Process.start()[/url], followed by [url="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.waitforexit%28v=vs.71%29.aspx"]Process.WaitForExit()[/url] was what I exactly needed.
Thanks for the very helpful advise.
Regards,
Dimitris

Share this post


Link to post
Share on other sites
Sign in to follow this