how can i resize window Console?
i did these code:
void SetWindowSize(COORD newsize)
{
PCONSOLE_SCREEN_BUFFER_INFOEX consolesize;
GetConsoleScreenBufferInfoEx(hConsole,consolesize);
COORD c;
consolesize->srWindow.Right = newsize.X+ consolesize->srWindow.Left;
consolesize->srWindow.Bottom = newsize.Y+ consolesize->srWindow.Top;
SetConsoleWindowInfo(hConsole, TRUE, &consolesize->srWindow);
PCONSOLE_FONT_INFO consolefont;
GetCurrentConsoleFont(hConsole, FALSE,consolefont);
GetConsoleFontSize(hConsole,consolefont->nFont);
c.X =(consolesize->srWindow.Right-consolesize->srWindow.Left)/consolefont->dwFontSize.X;
c.Y =(consolesize->srWindow.Bottom-consolesize->srWindow.Top)/consolefont->dwFontSize.Y;
DebugText("hello size " + to_string(c.X) + " " + to_string(c.Y));
SetConsoleScreenBufferSize( hConsole, c );
}
but i get a memory leak, or i see the scrollbars.
what i'm doing wrong?