Sign in to follow this  

Open an Executable file when pressing a button - Visual Studio 2005

This topic is 3870 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

Hi there! I have a project that has multiple buttons. When i press a button i need to open an executable file from within the project directory. I know about ShellExecute() function The problem is that when i close the file it keeps lauching it again and again This is problem no. 1. Problem no.2 is that i need to know when the executable file that i just lauched is closed becouse this exe file generates a .txt file that i need to open for viewing. So ... any sugestion? Thanks!

Share this post


Link to post
Share on other sites
#1 What do you mean "when you close the file"? The exe you executed using ShellExecute? ShellExecute - in my experience - only launches one instance of an executable

#2 Read about hooking the WM_DESTROY message. You can then determine if the window closing is the window in question, and then launch the file.

As well, here is a good place to start.

Share this post


Link to post
Share on other sites
Thanks for the help - the problem with exe beeing executed again and again after closing it was becouse of a stupid loop i dindnt sow - (the software is not made my me - i only changed some stuff in it).

Thanks again!

Share this post


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