c++ - 以编程方式告诉 PDCurses 使窗口与物理屏幕大小相同的方法?

标签 c++ linux windows-7 curses pdcurses

目前我有一个在 Win7/AIX/Linux 上运行的 C++ 控制台应用程序。在应用程序中,我使用 getmaxyx 获取窗口的尺寸。

getmaxyx(_window, _rows, _cols);

在 Windows 平台上,我需要尝试使用正在运行的应用程序的(属性)(布局)选项,以使屏幕最大化。这有点痛苦。

翻阅文档没有任何值(value)。

lines:  Specifies the number of lines the "screen" will have.
               Directly equates to LINES.
               There is no theoretical maximum.
               The minimum value must be 2.
               Default: 24
cols:   Specifies the number of columns the "screen" will have.
               Directly equates to COLS.
               There is no theoretical maximum.
               The minimum value must be 2.
               Default: 80

有什么技术可以让我将窗口调整为屏幕的物理尺寸吗?是否有使用 PDCurses 和 curses 的可移植方式?如果没有,是否有任何特定于平台的方法来实现此行为?

Possibly Related SO Question

Here perl does it with signals

最佳答案

        /* Resize the terminal to something larger than the physical screen */
        resize_term(2000, 2000);

        /* Get the largest physical screen dimensions */
        getmaxyx(_window, _rows, _cols);

        /* Resize so it fits */
        resize_term(_rows - 1, _cols - 1);

        /* Get the screen dimensions that fit */
        getmaxyx(_window, _rows, _cols);

关于c++ - 以编程方式告诉 PDCurses 使窗口与物理屏幕大小相同的方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18818600/

相关文章:

c++ - 在单个结构中处理不同的数据类型

Python匿名管道设置超时

内存问题

networking - netsh mbn show interfaces 导致在 Win7 64Bit 上找不到命令

c++ - dlib和windows函数冲突

c++ - Circle 类的问题和类成员的打印 vector

c++ - 无法从谷歌 Protocol Buffer 编译示例

windows-7 - Windows 7 bat 文件未作为服务启动

windows-7 - Windows 7 和蓝牙 4.0 智能

c++ - 128 位数字的位移位运算