开发者

Changing CMD window properties programmatically

开发者 https://www.devze.com 2022-12-17 22:47 出处:网络
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...

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/o开发者_开发技巧ff? Is there an API for this?


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.


another way: use reg /? to query your registry for reg query HKEY_CURRENT_USER\Console. There you can see keys like ScreenBufferSize etc. Use reg to delete the key and add it back with new values. Type reg /? on the command line to see its help usage. make sure you backup registry before trying.

0

精彩评论

暂无评论...
验证码 换一张
取 消