MultiMonitorEnumerator.h 797 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. class CMultiMonitorEnumerator
  3. {
  4. public:
  5. typedef struct _tagVMonitorInfo_t
  6. {
  7. HMONITOR hMonitor; //显示器句柄
  8. TCHAR szDevice[32]; //显示器名
  9. RECT rcVirtual; //虚拟显示屏坐标
  10. RECT rcMonitor; //物理显示坐标
  11. RECT rcWork; //工作显示坐标
  12. BOOL bPrimary; //主显示器?
  13. _tagVMonitorInfo_t()
  14. {
  15. memset(this, 0, sizeof(*this));
  16. }
  17. }VMONITORINFO, * LPVMONITORINFO;
  18. static BOOL CALLBACK MonitorEnumProc(
  19. HMONITOR hMonitor, // handle to display monitor
  20. HDC hdcMonitor, // handle to monitor-appropriate device context
  21. LPRECT lprcMonitor, // pointer to monitor intersection rectangle
  22. LPARAM dwData // data passed from EnumDisplayMonitors
  23. );
  24. public:
  25. CMultiMonitorEnumerator();
  26. public:
  27. int32_t m_iMontorNumber;
  28. VMONITORINFO m_MonitorInfoExArray[64];
  29. };