简体   繁体   English

如何获得其他连接的显示器的屏幕分辨率

[英]How to get screen resolution of other attached monitors

I am trying to get the Screen resolutions for all the attached physical monitor. 我正在尝试获取所有连接的物理显示器的屏幕分辨率。 I am able to get the screen resolution of primary monitor using Win API GetSystemMetrics (SM_CXSCREEN), GetSystemMetrics (SM_CYSCREEN). 我可以使用Win API GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN)获得主监视器的屏幕分辨率。 I am wondering how can i get the similar resolution value of other moniotrs 我想知道如何获得其他显示器的相似分辨率值

GetSystemMetrics SM_CXSCREEN / SM_CYSCREEN gets the primary monitor resolution. GetSystemMetrics SM_CXSCREEN / SM_CYSCREEN获取主监视器分辨率。 May also use GetDeviceCaps. 也可以使用GetDeviceCaps。 SM_CX/YVIRTUALSCREEN will get size for all monitors. SM_CX / YVIRTUALSCREEN将获取所有监视器的大小。

SystemParametersInfo SPI_GETWORKAREA will get the work area size on a monitor ie the size excluding taskbar and docked bars SystemParametersInfo SPI_GETWORKAREA将在监视器上获取工作区大小,即不包括任务栏和停靠栏的大小

GetMonitorInfo gets you the the size of specific monitor. GetMonitorInfo可以获取特定监视器的大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM