Skip to content

Commit

Permalink
Fix programs not using parent process consoles
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNNX authored and dz333n committed Apr 14, 2024
1 parent d585815 commit b667bfc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions COREDLL/stdio_wcecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@ static BOOL WceclAllocateStdio()
hOldStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
hOldStdErr = GetStdHandle(STD_ERROR_HANDLE);

if (hWndConsole == NULL &&
AttachConsole(ATTACH_PARENT_PROCESS))
{
hWndConsole = GetConsoleWindow();
}

if (hWndConsole == NULL)
{
AllocConsole();
Expand Down

0 comments on commit b667bfc

Please sign in to comment.