VirtualBox

Changeset 50467 in vbox for trunk/src/VBox/Additions/WINNT


Ignore:
Timestamp:
Feb 14, 2014 12:19:00 PM (11 years ago)
Author:
vboxsync
Message:

VBoxTray: VBoxDnD: NT compatibility.

Location:
trunk/src/VBox/Additions/WINNT/VBoxTray
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnD.cpp

    r50460 r50467  
    5858VBoxDnDWnd::VBoxDnDWnd(void)
    5959    : hWnd(NULL),
     60      mpfnEnumDisplayMonitors(NULL),
    6061      mfMouseButtonDown(false),
    6162#ifdef VBOX_WITH_DRAG_AND_DROP_GH
     
    8485    /* Save the context. */
    8586    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    }
    8694
    8795    int rc = RTSemEventCreate(&mEventSem);
     
    10861094    if (hDC)
    10871095    {
    1088         fRc = EnumDisplayMonitors(hDC, NULL, VBoxDnDWnd::MonitorEnumProc,
    1089                                   (LPARAM)&r);
     1096        fRc = mpfnEnumDisplayMonitors?
     1097                  mpfnEnumDisplayMonitors(hDC, NULL, VBoxDnDWnd::MonitorEnumProc, (LPARAM)&r):
     1098                  FALSE;
     1099
    10901100        if (!fRc)
    10911101            rc = VERR_NOT_FOUND;
     
    10991109        /* If multi-monitor enumeration failed above, try getting at least the
    11001110         * 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;
    11101116    }
    11111117
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnD.h

    r50399 r50467  
    366366    /** The window's handle. */
    367367    HWND                       hWnd;
     368    BOOL (WINAPI* mpfnEnumDisplayMonitors)(HDC, LPCRECT, MONITORENUMPROC, LPARAM);
    368369    /** List of allowed MIME types this
    369370     *  client can handle. Make this a per-instance
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette