3

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.

Quimby
  • 17,735
  • 4
  • 35
  • 55
Marquetes2
  • 35
  • 1
  • 5
  • Does this answer your question? [Create Window larger than desktop (display resolution)](https://stackoverflow.com/questions/445893/create-window-larger-than-desktop-display-resolution) – user1810087 Aug 25 '21 at 09:29
  • Have you an Nvidia driver with NView enabled? It could be hooking your Win32 messages to clip window size to desktop coordinates... – Luca Aug 25 '21 at 09:45
  • @Luca I've looked for that, and it seems like I'm using it to manage multiple screens. Should I disable it? And it will actually make me able to resize the terminal? – Marquetes2 Aug 25 '21 at 10:02
  • @user1810087 I looked at that post, but it seems that no longer works on Windows 10. I will keep trying. – Marquetes2 Aug 25 '21 at 10:03
  • @MarcosRoudri I 'd give a try. I remember that it had an option to avoid windows outside desktop area. – Luca Aug 25 '21 at 11:08
  • @Luca I'll try and share my results. Thanks :) – Marquetes2 Aug 25 '21 at 11:35

2 Answers2

1

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:

zadjii
  • 529
  • 2
  • 4
1

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.

jorrit
  • 11
  • 1