Changeset 50467 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Feb 14, 2014 12:19:00 PM (11 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/VBoxTray
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnD.cpp
r50460 r50467 58 58 VBoxDnDWnd::VBoxDnDWnd(void) 59 59 : hWnd(NULL), 60 mpfnEnumDisplayMonitors(NULL), 60 61 mfMouseButtonDown(false), 61 62 #ifdef VBOX_WITH_DRAG_AND_DROP_GH … … 84 85 /* Save the context. */ 85 86 this->pContext = pContext; 87 88 HMODULE hUser = GetModuleHandle("user32.dll"); 89 if (hUser) 90 { 91 *(uintptr_t *)&mpfnEnumDisplayMonitors = (uintptr_t)GetProcAddress(hUser, "EnumDisplayMonitors"); 92 Log(("DnD: EnumDisplayMonitors = %p\n", mpfnEnumDisplayMonitors)); 93 } 86 94 87 95 int rc = RTSemEventCreate(&mEventSem); … … 1086 1094 if (hDC) 1087 1095 { 1088 fRc = EnumDisplayMonitors(hDC, NULL, VBoxDnDWnd::MonitorEnumProc, 1089 (LPARAM)&r); 1096 fRc = mpfnEnumDisplayMonitors? 1097 mpfnEnumDisplayMonitors(hDC, NULL, VBoxDnDWnd::MonitorEnumProc, (LPARAM)&r): 1098 FALSE; 1099 1090 1100 if (!fRc) 1091 1101 rc = VERR_NOT_FOUND; … … 1099 1109 /* If multi-monitor enumeration failed above, try getting at least the 1100 1110 * primary monitor as a fallback. */ 1101 MONITORINFO monitor_info; 1102 monitor_info.cbSize = sizeof(monitor_info); 1103 if (GetMonitorInfo(MonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST), 1104 &monitor_info)) 1105 { 1106 1107 r = monitor_info.rcMonitor; 1108 rc = VINF_SUCCESS; 1109 } 1111 r.left = 0; 1112 r.top = 0; 1113 r.right = GetSystemMetrics(SM_CXSCREEN); 1114 r.bottom = GetSystemMetrics(SM_CYSCREEN); 1115 rc = VINF_SUCCESS; 1110 1116 } 1111 1117 -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnD.h
r50399 r50467 366 366 /** The window's handle. */ 367 367 HWND hWnd; 368 BOOL (WINAPI* mpfnEnumDisplayMonitors)(HDC, LPCRECT, MONITORENUMPROC, LPARAM); 368 369 /** List of allowed MIME types this 369 370 * client can handle. Make this a per-instance
Note:
See TracChangeset
for help on using the changeset viewer.