I don't know if this has been discussed before - is there a way to stop a console window from closing - like an IDE does it?
The console app is a third party program that finishes and closes before the output can be read.
Using for example ShellExecute().
Ta!
John
Hi John,
Why not to launch the console application from the command prompt?
Quote from: Vortex on December 09, 2008, 11:53:17 AM
Hi John,
Why not to launch the console application from the command prompt?
Vortex,
Well, it just isn't going to be started that way.
However as a matter of interest if it was started from the command prompt, is there a way to stop it closing its window?
John
Use CMD /K to launch it.
Hi John,
Maybe, you can try to hook the ExitProcess function to stop the console windows from closing.
Quote from: Vortex on December 09, 2008, 12:32:07 PM
Hi John,
Maybe, you can try to hook the ExitProcess function to stop the console windows from closing.
Yes, I was looking for an easier way, see above.
Thanks.
John
another way could be using CreateProcess and use pause command in lpCommandLine like this
CreateProcess(NULL, "program.exe | pause", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
WaitForSingleObject(pi.hProcess, INFINITE);
Quote from: blzbb on December 10, 2008, 09:51:31 AM
another way could be using CreateProcess and use pause command in lpCommandLine like this
CreateProcess(NULL, "program.exe | pause", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
WaitForSingleObject(pi.hProcess, INFINITE);
Ok, thank you.
John