Fix constructing of monitor
This commit is contained in:
parent
3361dcf088
commit
1e7e0b4e6d
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <physicalmonitorenumerationapi.h>
|
#include <physicalmonitorenumerationapi.h>
|
||||||
@ -18,12 +19,19 @@ class Monitor {
|
|||||||
Monitor() = delete;
|
Monitor() = delete;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
struct PhysicalMonitor {
|
||||||
|
PhysicalMonitor(HANDLE handle, const WCHAR* name) : handle(handle), name(name) {}
|
||||||
|
|
||||||
|
HANDLE handle;
|
||||||
|
std::wstring name;
|
||||||
|
};
|
||||||
|
|
||||||
friend BOOL detail::enumMonitorsCallback(HMONITOR, HDC, LPRECT, LPARAM);
|
friend BOOL detail::enumMonitorsCallback(HMONITOR, HDC, LPRECT, LPARAM);
|
||||||
|
|
||||||
Monitor(HMONITOR hMonitor, PHYSICAL_MONITOR hPhysicalMonitor);
|
Monitor(HMONITOR hMonitor, PHYSICAL_MONITOR physicalMonitor);
|
||||||
|
|
||||||
const HMONITOR m_hMonitor;
|
const HMONITOR m_hMonitor;
|
||||||
const PHYSICAL_MONITOR m_physicalMonitor;
|
const PhysicalMonitor m_physicalMonitor;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
Monitor::Monitor(HMONITOR hMonitor, PHYSICAL_MONITOR hPhysicalMonitor) : m_hMonitor(hMonitor), m_physicalMonitor(m_physicalMonitor) {}
|
Monitor::Monitor(HMONITOR hMonitor, PHYSICAL_MONITOR physicalMonitor)
|
||||||
|
: m_hMonitor(hMonitor)
|
||||||
|
, m_physicalMonitor(physicalMonitor.hPhysicalMonitor, physicalMonitor.szPhysicalMonitorDescription)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user