前段时间要做多屏程序,为了获取屏幕的真实尺寸,还是花了一番功夫的,目前大部分程序所说的实际上只能获取逻辑尺寸(毫米),不能获取真实的值。下面是C++代码:
C++ 代码:
/****************************************************************************************
** DisplayDevices.h
**
** CopyRight @ chcucl@qq.com
**
** Created at 2014/03/25 10:50
**
**
**
**
**
*****************************************************************************************/
#pragma once
#pragma warning(push)
#pragma warning(disable:4995)
#include <vector>
/*
* DSPDEV
*
* It includes parameters of a display device.
*/
struct DSPDEV
{
/* posx,posy: the position of this display device locating in virtual-desktop */
int posx;
int posy;
/* rsow, rsoh: the width and height of resolution of this display device, in pixels */
int rsow;
int rsoh;
/* mliw, mlih: the width and height of dispaly device, i