I am creating a simple GUI in C++ which have few buttons in it. I want to launch some external .exe files when i click on these buttons.
What's the code to achieve this?
I am creating a simple GUI in C++ which have few buttons in it. I want to launch some external .exe files when i click on these buttons.
What's the code to achieve this?
In its simplest form: system("c:\\path\\to\\binary.exe");
.
If you need more control, use something like CreateProcess()
.
Take a look at CreateProcess(). You can also use system() but system() doesn't return until the process you called exits.
Avoid the system() solution, see this post for an explaination. You should use CreateProcess for executables and ShellExecute to open files with their associated application.