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

Started by
1 comment, last by guvidu 16 years, 10 months ago
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!
Advertisement
#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.
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!

This topic is closed to new replies.

Advertisement