Improve startConsole()
* Also try to allocate new console * Don't set buffer info (seems to have not effect anyways)
This commit is contained in:
parent
9a395a45d3
commit
5dac8fc76b
|
@ -43,12 +43,9 @@ bool confirmPrompt(const char *message, Response defaultResponse)
|
|||
*/
|
||||
void startConsole()
|
||||
{
|
||||
AttachConsole(ATTACH_PARENT_PROCESS);
|
||||
CONSOLE_SCREEN_BUFFER_INFO coninfo;
|
||||
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo);
|
||||
coninfo.dwSize.X = 200;
|
||||
coninfo.dwSize.Y = 500;
|
||||
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize);
|
||||
if(!AttachConsole(ATTACH_PARENT_PROCESS) && !AllocConsole()) {
|
||||
return;
|
||||
}
|
||||
// redirect stdout
|
||||
auto stdHandle = reinterpret_cast<intptr_t>(GetStdHandle(STD_OUTPUT_HANDLE));
|
||||
auto conHandle = _open_osfhandle(stdHandle, _O_TEXT);
|
||||
|
|
Loading…
Reference in New Issue