News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

console buffer-resizing

Started by pro3carp3, September 21, 2005, 06:41:17 PM

Previous topic - Next topic

pro3carp3

Is there a way to disallow the user from changing the console buffer size?  I'm in the initial stages of a project where I'd like to have complete control of the console buffer.  Any suggestions?  Thanks.
LGC

MichaelW

I don't know how you could *stop* the user from resizing the console screen buffer, but you can arrange to be notified of the resize event (polling required), and either undo the resize or (better IMO) adjust to it.

See 'Buffer-Resizing Events' here.

hth


eschew obfuscation

pro3carp3

Just as I suspected.  Related to my previous question, do you know of any way (via the regestry perhaps) to set the font and font size?
LGC

MichaelW

According to this "Microsoft does not provide a programmatic way to change the font after the console window has been created." But perhaps Microsoft is moving in that direction because for Windows "Longhorn" and XP you can get the current console font and font size:

MSDN: GetCurrentConsoleFont

There is some information on doing it through the registry here (on page 2):

http://www.masmforum.com/simple/index.php?topic=1745.0


eschew obfuscation

pro3carp3

Thank you for the link to the discussion.  It has some great information that will take a while to digest.  I hadn't come across the GetCurrentConsoleFont function.  It isn't in Win32.hlp. 
LGC

pro3carp3

I see there are several newer console functions described at msdn.  A couple of them make reference to a system console font table, but don't provide any additional information.  What is the structure of this table and how do I access it?  Thanks.
LGC

MichaelW

I could not find any information on the system console font table.

I had forgotten about the undocumented SetConsoleFont function that Phoenix referred to here:

http://www.masmforum.com/simple/index.php?topic=1745.msg14316#msg14316

And for kernel32.dll version 5.0.2195.7006 (Windows 2000) SetConsoleFont is included in the exported functions. Perhaps someone could check this for Windows 98.

eschew obfuscation