Changing CMD window properties programmatically

cmd, windows

Solution

Search engines are amazing things :).

Search for Windows Console API and the 2nd link is: this. Digging in a tiny bit more and you find the interestingly named "SetConsoleMode" and "SetConsoleScreenBufferSize" APIs which appear to set the console mode (which includes quick edit mode) and screen buffer size.

I've not used the APIs so I don't know if there are any caveats, but from the documentation, these seem to be what you're looking for.

Problem

How can I change the appearance of my current CMD window? I know there is a 'mode' and 'color' commands that give you some control, but it's not enough... Is it possible to change Screen Buffer Size separately? To turn QuickEdit mode on/off? Is there an API for this?

Original source