获取当前显示屏分辨率
就是显示控制台窗口的那个显示屏的分辨率
#include <Windows.h>
#include <stdio.h>
int main()
{
int nScreenWidth, nScreenHeight;
nScreenWidth = GetSystemMetrics(SM_CXSCREEN);
nScreenHeight = GetSystemMetrics(SM_CYSCREEN);
printf("当前屏幕的分辨率为:%d×%d", nScreenWidth, nScreenHeight);
getchar();
return 0;
}
运行结果:
当前屏幕的分辨率为:1920×1080
获取显示屏个数
我现在的电脑接了4个显示屏。
#include <Win