need: change "Screen buffer size" for console

Just starting out? Need help? Post your questions and find answers here.
User avatar
unhappy
User
User
Posts: 19
Joined: Sat Dec 10, 2005 6:58 am
Location: Prague, Czech Republic

need: change "Screen buffer size" for console

Post 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 )
Last edited by unhappy on Fri Nov 10, 2006 7:57 am, edited 1 time in total.
--- no signal
User avatar
unhappy
User
User
Posts: 19
Joined: Sat Dec 10, 2005 6:58 am
Location: Prague, Czech Republic

Post 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?
--- no signal
User avatar
unhappy
User
User
Posts: 19
Joined: Sat Dec 10, 2005 6:58 am
Location: Prague, Czech Republic

Post 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)
--- no signal
Post Reply