How to display cmd prompt after printing output to cmd.exe?
问题 I have an winmain application that is executed from cmd.exe and prints output to it. I atach to the cmd.exe using AttachConsole(ATTACH_PARENT_PROCESS) . After application is executed and output is printed to cmd.exe command line prompt is not displayed and it looks like application is stil running(while it is already closed). Before closing my application I release the console using FreeConsole() . #include <iostream> #include <fstream> #include <windows.h> int wWinMain ( HINSTANCE hInstance,