I have been trying to figure out how to resize the console window. Here is the code of a function i am using:
#include <windows.h>
#include <stdio.h>
#define WIDTH 70
#define HEIGHT 35
HANDLE wHnd;
void setup() {
SMALL_RECT windowSize = {0, 0, WIDTH - 1, HEIGHT - 1};
COORD bufferSize = { WIDTH , HEIGHT };
wHnd = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTitle("Conway's Game of Life");
SetConsoleWindowInfo(wHnd, 1, &windowSize);
SetConsoleScreenBufferSize(wHnd, bufferSize);
}
While it works for small widths and heights (like 70 and 35). it does not for the size I need (almost twice as big and yes i resized the buffersize accordingly, always a bit bigger than windowSize). Then it just is the regular size. My next thought was, since it already is quite big, why not go fullscreen.
SetConsoleDisplayMode(wHnd, CONSOLE_FULLSCREEN_MODE, 0);
Before this code snippet worked without a problem but now it does not, not even on other PCs. It stopped working on older projects too weirdly enough.
Any idea how I could launch it in fullscreen? (ALT + ENTER works) Or make the console window big at launch? I had a look at ncurses but I am on Windows 10 and don't know how to use it, besides that my Prof probably doesn't want me to use external libraries. Thanks for your help! Let me know if I forgot something.