我可以更改控制台 Window 大小吗?
Can I change the Console Window Size?
我目前正在编写 C++ 程序,我知道您可以更改文本颜色,但我也想知道您是否可以更改控制台 Window 大小,如果可以,如何更改?
(不是在谈论 Win32 应用程序)
这是一个例子:
#include<iostream>
#include<windows.h>
using namespace std;
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
int main(){ cout<<"Hello World"; }
或者你应该使用
SetConsoleScreenBufferSize
SetConsoleWindowInfo
There's an example at http://www.cplusplus.com/forum/windows/10731/
我目前正在编写 C++ 程序,我知道您可以更改文本颜色,但我也想知道您是否可以更改控制台 Window 大小,如果可以,如何更改?
(不是在谈论 Win32 应用程序)
这是一个例子:
#include<iostream>
#include<windows.h>
using namespace std;
SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
int main(){ cout<<"Hello World"; }
或者你应该使用
SetConsoleScreenBufferSize
SetConsoleWindowInfo
There's an example at http://www.cplusplus.com/forum/windows/10731/