this is working for me
Tested on windows 7
Function SetConsuleBufferWindowSize
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
Tested on windows 7
Function SetConsuleBufferWindowSize
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