Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Incease the buffer size of the cmd window
#2
this is working for me
Tested on windows 7

Function SetConsuleBufferWindowSize
Code:
Copy      Help
int w
run "$system$\cmd.exe" "" "" "*" 0x10800 win("" "ConsoleWindowClass") w

int hwnd
if(!hwnd) hwnd=w; if(!hwnd) ret
if(!GetWindowThreadProcessId(hwnd &_i)) ret
lock
FreeConsole
if(!AttachConsole(_i)) ret

CONSOLE_SCREEN_BUFFER_INFOEX consolesize

consolesize.cbSize=sizeof(consolesize)

int hConsole = GetStdHandle(STD_OUTPUT_HANDLE)

GetConsoleScreenBufferInfoEx(hConsole &consolesize)

;note Screen Buffer Size width must be => than Window Size width for it to resize properly
COORD c
c.X = 100;;Screen Buffer Size width
c.Y = 40;;Screen Buffer Size height
consolesize.dwSize = c;
consolesize.srWindow.Left = 0
consolesize.srWindow.Right = 100;;Window Size width
consolesize.srWindow.Top = 0
consolesize.srWindow.Bottom = 40;;Window Size height
consolesize.dwMaximumWindowSize = c;
SetConsoleScreenBufferInfoEx(hConsole &consolesize)

FreeConsole


Note on windows 10 i don't need this at all can directly resize window using siz function or max for full size window.

@ Gintaras please correct any mistakes you see


Messages In This Thread
RE: Incease the buffer size of the cmd window - by Kevin - 07-18-2018, 10:08 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)