Page 1 of 1

console buffer size

Posted: Mon Feb 06, 2006 11:04 pm
by mdp
I try to change a console buffer (read: the max width of text, indipendent from the window size)

Code: Select all

OpenConsole() : stdout.l=GetStdHandle_(#STD_OUTPUT_HANDLE)  
sz.COORD : sz\x=120 : sz\y=200

;sbi.console_screen_buffer_info : getconsolescreenbufferinfo_(stdout,sbi) 

ok=setconsolescreenbuffersize_(stdout,@sz)
PrintN( Str(ok) )
PrintN( Str( getlasterror_() ) )
Delay(3000)
but I get error 87 (invalid parameter).
Anybody can see why?

Posted: Mon Feb 06, 2006 11:41 pm
by Fred
You need to pass a COORD structure, not an adress to a COORD struct. Basically here it's only a long:

Code: Select all

OpenConsole() : stdout.l=GetStdHandle_(#STD_OUTPUT_HANDLE) 
sz.COORD : sz\x=120 : sz\y=200

;sbi.console_screen_buffer_info : getconsolescreenbufferinfo_(stdout,sbi)

ok=SetConsoleScreenBufferSize_(stdout,120 | (200 << 16))
PrintN( Str(ok) )
PrintN( Str( GetLastError_() ) )
Delay(3000)

Posted: Tue Feb 07, 2006 9:21 am
by mdp
Thanks!