Reputation: 65
I'm testing something and I would like to create a Windows Terminal with bigger dimensions than the current screen. I know it sounds like a stupid idea, but it is what I'm trying to achieve.
I've tried different things like:
HWND console = GetConsoleWindow();
RECT r;
GetWindowRect(console, &r);
MoveWindow(console, r.left, r.top, 100, 3000, TRUE);
And:
DWORD CurrentMode;
GetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), &CurrentMode);
SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), CurrentMode | ENABLE_VIRTUAL_TERMINAL_PROCESSING);
fputs("\x1b[8;30;800t", stdout);
I found both methods on different posts. Both methods change the Terminal dimensions, but that dimension can't be bigger than the screen. I have also realized that you can't (or at least, I wasn't able to) manually resize the Windows Terminal to have bigger dimensions that the screen.
It seems like an impossible task, but maybe someone has any idea on how to do it. Thanks for the help.
Upvotes: 4
Views: 608
Reputation: 11
Use Gimespace desktop extender, it is able to lift this size restriction on almost any program I have used. You will have to enable x64 bit mode if you run windows x64 and if it doesn't work while running this program you can force a specific size by selecting the "set windows size" command from the tray icon menu. But the setwindowpos api call should also work when the desktop extender is running.
Upvotes: 1
Reputation: 684
GetConsoleWindow
very specifically doesn't work for the Windows Terminal like it used to for the vintage console, conhost.exe
. When called in Windows Terminal, it's going to give you back a dummy HWND
, not the actual HWND
of the Terminal window. FWIW, it's generally not recommended to use that API moving forward.
Even with using the \x1b[8;;t
sequence to resize the console, the console very specifically has code to prevent itself from being resized larger than the size of the monitor it's currently on. See:
Upvotes: 2