【发布时间】:2016-12-06 15:08:33
【问题描述】:
我将 Windows 屏幕分辨率设置为 1920x1080。
我有 c++ windows API 程序,需要使用GetSystemMetrics 函数。
int x = GetSystemMetrics(SM_CXSCREEN);//retun x=1536
int y = GetSystemMetrics(SM_CYSCREEN);//retun y=864
如您所见,我得到的值与 1920x1080 不同。
但是如果我在程序设置中使用MFC headers (afx.h) 并使用MFC dlls,那么返回值x,y 等于windows 屏幕分辨率( 1920x1080)。
为什么这两种方法不一样?
如何在不使用 MFC 的情况下在我的程序中获得正确的 Windows 屏幕分辨率?
【问题讨论】:
标签: c++ winapi mfc screen-resolution