Detach and reattach console on start
This commit is contained in:
parent
934fd3881c
commit
20a4d53b22
1 changed files with 7 additions and 5 deletions
|
@ -37,12 +37,14 @@ void SetupStreams()
|
|||
|
||||
void SetupConsole()
|
||||
{
|
||||
if (!AllocConsole())
|
||||
{
|
||||
FreeConsole();
|
||||
AllocConsole();
|
||||
if (!AttachConsole(-1)) {
|
||||
if (!AllocConsole())
|
||||
{
|
||||
FreeConsole();
|
||||
AllocConsole();
|
||||
}
|
||||
AttachConsole(GetCurrentProcessId());
|
||||
}
|
||||
AttachConsole(GetCurrentProcessId());
|
||||
SetupStreams();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue