调整 CMD 窗口大小
如何在 C 或 C++ 中以编程方式调整命令提示符窗口的大小?例如 80x25 或 80x40 字符。先感谢您。
How can I resize the Command Prompt window programmatically in C or C++? For example 80x25 or 80x40 characters. Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
SetConsoleWindowInfo
SetConsoleWindowInfo
MODE 命令允许您设置命令提示符窗口的大小。语法是:
例如,对于 80x25 窗口,您将使用
This size is associated with a specific instance of the window so other command windows will be set to the default size. It works in both newer WinNT based OSs (i.e. Win2000/XP/7) and Win9x. If the size is not supported it will not change.
将其放在任何输出之前,因为它会清除屏幕。
The MODE command allows you to set the size of the Command Prompt window. The syntax is:
For example for a 80x25 window you would use
This size is associated with a specific instance of the window so other command windows will be set to the default size. It works in both newer WinNT based OSs (i.e. Win2000/XP/7) and Win9x. If the size is not supported it will not change.
Place it before any output, as it clears the screen.
我做了一些更多的研究,这就是我得出的结论:
I did some more research and this is what I came up with: