如何在C++中获取窗口的分辨率

How do I get the resolution of a window in C++?

本文关键字:窗口 分辨率 获取 C++      更新时间:2023-10-16
#include <windows.h>
int main()
{
    HDC Window = GetWindowDC(FindWindow(NULL,"Window Example Title"));

    return 0;
}

如何获得窗口的分辨率,例如这样?

大概你的意思是可用的图形区域,在Windows中称为工作区

您可以使用GetClientRect函数查找其当前大小。

窗口本身有一个相应的GetWindowRect