how do i change the window buffer size?
I took part of this code from one of the posts and change dit a bit, sometimes it changes the window size, sometimes it changes the screen buffer size:
Code:
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
HWND hWnd;
hWnd = FindWindow(NULL, "test");
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
COORD NewSBSize = GetLargestConsoleWindowSize(hOut);
SMALL_RECT DisplayArea = {0, 0, 0, 0};
for (;;){
cin>>NewSBSize.X>>NewSBSize.Y;
DisplayArea.Right = NewSBSize.X - 1;
DisplayArea.Bottom = NewSBSize.Y - 1;
SetConsoleWindowInfo(hOut, TRUE, &DisplayArea);
SetConsoleScreenBufferSize(hOut, NewSBSize);
}
ShowWindow(hWnd, SW_MAXIMIZE);
return 0;
}
Ok, i fixed the problem, for some reason it had the same problem as cin.get() where i have to put them in twice...