Detach and reattach console on start
This commit is contained in:
parent
934fd3881c
commit
20a4d53b22
|
@ -37,12 +37,14 @@ void SetupStreams()
|
||||||
|
|
||||||
void SetupConsole()
|
void SetupConsole()
|
||||||
{
|
{
|
||||||
if (!AllocConsole())
|
if (!AttachConsole(-1)) {
|
||||||
{
|
if (!AllocConsole())
|
||||||
FreeConsole();
|
{
|
||||||
AllocConsole();
|
FreeConsole();
|
||||||
|
AllocConsole();
|
||||||
|
}
|
||||||
|
AttachConsole(GetCurrentProcessId());
|
||||||
}
|
}
|
||||||
AttachConsole(GetCurrentProcessId());
|
|
||||||
SetupStreams();
|
SetupStreams();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue