OpenConsole() Inhibit F11 fullscreen mode

Windows specific forum
Oso
Enthusiast
Enthusiast
Posts: 595
Joined: Wed Jul 20, 2022 10:09 am

OpenConsole() Inhibit F11 fullscreen mode

Post by Oso »

Following the recent thread about inhibiting CTRL/C, does anyone know if there is a way to prevent F11 fullscreen mode? F11 brings unwanted consequences, including the obvious change of screen geometry from the more recent standard of 30 lines.

EDIT — I found it at last, the API is SetConsoleMode and it works well.

Code: Select all

DWORD previousMode; // typically(?) 0x1f7
GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &previousMode);
auto newMode = previousMode & (~ENABLE_PROCESSED_INPUT);
SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), newMode);