Page 1 of 1

need: change "Screen buffer size" for console

Posted: Thu Nov 09, 2006 2:27 pm
by unhappy
hi, All!
i need to change "Screen buffer size" value for window created with OpenConsole(). the value 300 is to large for me.
advice me plz )

Posted: Fri Nov 10, 2006 7:51 am
by unhappy
ok.
i think what i found some usefull info - function SetConsoleScreeBufferSize_ from http://msdn.microsoft.com

Code: Select all

If OpenConsole()   
  stdout.l=GetStdHandle_(#STD_OUTPUT_HANDLE)  
  mySize.COORD
  mySize\x = 80
  mySize\y = 29
  SetConsoleScreenBufferSize_(stdout, mySize)
  Debug(Str(GetLastError_()) )
  Input()
EndIf
but after execution this code my concole buffer not changed and i recieve in a debug window error code 87 (from MSDN i read next: ERROR_INVALID_PARAMETER - The parameter is incorrect.)
Anybody knows - what i doing incorrect?

Posted: Tue Aug 28, 2007 9:21 am
by unhappy
correct:

Code: Select all

If OpenConsole()    
  stdout.l=GetStdHandle_(#STD_OUTPUT_HANDLE)  
  mySize.l = (51 << 16) + 51
  SetConsoleScreenBufferSize_(stdout, mySize) 
  Debug(Str(GetLastError_()) ) 
  Input() 
EndIf
(from http://forum.oszone.net/thread-75006.html)