how can i resize a window console buffer?
i know that i can use the SetConsoleScreenBufferSize(), but i'm getting problems convert from pixels to characters, because the vertical scrollbar is showed and the size isn't changed correctly, because it's more big than the buffer size:
CONSOLE_SCREEN_BUFFER_INFOEX consolesize;
consolesize.cbSize=sizeof(consolesize);
GetConsoleScreenBufferInfoEx(hConsole,&consolesize);
COORD c;
consolesize.srWindow.Right = newsize.X+consolesize.srWindow.Right;
consolesize.srWindow.Bottom = newsize.Y + consolesize.srWindow.Left;
CONSOLE_FONT_INFO consolefont={0} ;
GetCurrentConsoleFont(hConsole, FALSE,&consolefont);
GetConsoleFontSize(hConsole,consolefont.nFont);
c.X =(consolesize.srWindow.Right)/consolefont.dwFontSize.X;
c.Y =(consolesize.srWindow.Bottom)/consolefont.dwFontSize.Y;
SetConsoleScreenBufferSize( hConsole, c );
SetConsoleWindowInfo(hConsole, FALSE, &consolesize.srWindow);
how can i fix these problem?