Closed siaccarino closed 2 years ago
Before you exit a program with an attached console you should
Example:
bool consoleAttached = false; // Use command line processing instead FILE* f1 = NULL, * f2 = NULL, * f3 = NULL; if (AttachConsole(ATTACH_PARENT_PROCESS)) { f1 = freopen("CONIN$", "r", stdin); f2 = freopen("CONOUT$", "w", stdout); f3 = freopen("CONOUT$", "w", stderr); consoleAttached = true; } int result = run(); if (consoleAttached) { fclose(f1); fclose(f2); fclose(f3); keybd_event(VK_RETURN, VK_RETURN, 0, 0); FreeConsole(); } return result;
Fixed! Thanks.
Before you exit a program with an attached console you should
Example: