Changeset 72011 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 25, 2018 12:21:09 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp
r71429 r72011 59 59 } MONITOR_DPI_TYPE; 60 60 61 boolMonitorEnumProcF(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lpClipRect, LPARAM dwData)61 static BOOL CALLBACK MonitorEnumProcF(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lpClipRect, LPARAM dwData) 62 62 { 63 63 /* These required for clipped screens only: */ … … 432 432 433 433 #ifdef VBOX_WS_WIN 434 435 /* Dynamically access User32.dll: */ 436 QLibrary user32("User32.dll", NULL); 437 438 /* Enumerate available monitors through EnumDisplayMonitors (available since Windows 2k): */ 439 typedef bool (*MonitorEnumProcFP)(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lpClipRect, LPARAM dwData); 440 typedef bool (*EnumDisplayMonitorsFP)(HDC hdc, LPCRECT lprcRect, MonitorEnumProcFP lpfnEnum, LPARAM dwData); 441 EnumDisplayMonitorsFP EnumDisplayMonitorsF = (EnumDisplayMonitorsFP)user32.resolve("EnumDisplayMonitors"); 442 if (EnumDisplayMonitorsF) 434 /* Dynamically resolve EnumDisplayMonitors (available since Windows 2k) first time through: */ 435 static bool volatile s_fResolved = false; 436 static decltype(EnumDisplayMonitors) *s_pfnEnumDisplayMonitors = NULL; 437 decltype(EnumDisplayMonitors) *pfnEnumDisplayMonitors; 438 if (s_fResolved) 439 pfnEnumDisplayMonitors = s_pfnEnumDisplayMonitors; 440 else 441 { 442 pfnEnumDisplayMonitors = (decltype(EnumDisplayMonitors) *)GetProcAddress(GetModuleHandleW(L"USER32.DLL"), 443 "EnumDisplayMonitors"); 444 s_pfnEnumDisplayMonitors = pfnEnumDisplayMonitors; 445 s_fResolved = true; 446 } 447 448 /* Enumerate available monitors through EnumDisplayMonitors if available: */ 449 if (pfnEnumDisplayMonitors) 443 450 { 444 451 QList<QPair<int, int> > listOfScreenDPI; 445 EnumDisplayMonitorsF(0, 0, MonitorEnumProcF, (LPARAM)&listOfScreenDPI);452 pfnEnumDisplayMonitors(0, 0, MonitorEnumProcF, (LPARAM)&listOfScreenDPI); 446 453 if (iHostScreenIndex >= 0 && iHostScreenIndex < listOfScreenDPI.size()) 447 454 {
Note:
See TracChangeset
for help on using the changeset viewer.