简体   繁体   English

在C中更改控制台的高度和宽度

[英]Change console height and width in c

Do you know which library or function should I use to change Console Application width and height in C without using windows or GUI header? 您是否知道在不使用Windows或GUI标头的情况下,应该使用哪个库或函数来更改C中的Console Application宽度和高度? Im using code:blocks . 我正在使用code:blocks。

试试ncurses库...它会做得比你想做的还要多

In the case of the console, it is simply another window, except that it is considered "special" by Windows since it serves a certain purpose, which means you have two options: 对于控制台,它只是另一个窗口,但Windows认为它是“特殊”的,因为它有特定的用途,这意味着您有两个选择:

  • use the console API, a small subset of the Windows API, or 使用控制台API,Windows API的一小部分或
  • get the window handle of the console somehow and resize it directly. 以某种方式获取控制台的窗口句柄并直接调整其大小。

Both require use of the Windows API, so your answer is to use the Windows API. 两者都需要使用Windows API,因此您的答案是使用Windows API。 You can't avoid it. 你无法避免。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM