VirtualBox

Ignore:
Timestamp:
May 7, 2014 3:05:59 PM (11 years ago)
Author:
vboxsync
Message:

DnD/VBoxTray: Added support for Windows Aero Snap (window snapping).

File:
1 edited

Legend:

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

    r50561 r51206  
    3636
    3737#include <VBoxGuestInternal.h>
     38#ifdef LOG_GROUP
     39# undef LOG_GROUP
     40#endif
     41#define LOG_GROUP LOG_GROUP_GUEST_DND
     42#include <VBox/log.h>
    3843
    3944/* Enable this define to see the proxy window(s) when debugging
     
    303308            LogFlowThisFunc(("WM_LBUTTONUP\n"));
    304309            mfMouseButtonDown = false;
     310
     311            /* As the mouse button was released, Hide the proxy window again.
     312             * This can happen if
     313             * - the user bumped a guest window to the screen's edges
     314             * - there was no drop data from the guest available and the user
     315             *   enters the guest screen again after this unsuccessful operation */
     316            reset();
    305317            return 0;
    306318
     
    951963        {
    952964            uDefAction = DND_COPY_ACTION;
    953             /** @todo Support more than one action at a time. */
    954             uAllActions = uDefAction;
    955965
    956966            LogFlowFunc(("Acknowledging pDropTarget=0x%p, uDefAction=0x%x, uAllActions=0x%x, strFormats=%s\n",
    957967                         pDropTarget, uDefAction, uAllActions, strFormats.c_str()));
    958             rc = VbglR3DnDGHAcknowledgePending(mClientID,
    959                                                uDefAction, uAllActions, strFormats.c_str());
    960             if (RT_FAILURE(rc))
     968        }
     969        else
     970        {
     971            strFormats = "unknown"; /* Prevent VERR_IO_GEN_FAILURE for IOCTL. */
     972            LogFlowFunc(("No format data available yet\n"));
     973        }
     974
     975        /** @todo Support more than one action at a time. */
     976        uAllActions = uDefAction;
     977
     978        rc = VbglR3DnDGHAcknowledgePending(mClientID,
     979                                           uDefAction, uAllActions, strFormats.c_str());
     980        if (RT_FAILURE(rc))
     981        {
     982            char szMsg[256]; /* Sizes according to MSDN. */
     983            char szTitle[64];
     984
     985            /** @todo Add some i18l tr() macros here. */
     986            RTStrPrintf(szTitle, sizeof(szTitle), "VirtualBox Guest Additions Drag'n Drop");
     987            RTStrPrintf(szMsg, sizeof(szMsg), "Drag'n drop to the host either is not supported or disabled. "
     988                                              "Please enable Guest to Host or Bidirectional drag'n drop mode "
     989                                              "or re-install the VirtualBox Guest Additions.");
     990            switch (rc)
    961991            {
    962                 char szMsg[256]; /* Sizes according to MSDN. */
    963                 char szTitle[64];
    964 
    965                 /** @todo Add some translation macros here. */
    966                 RTStrPrintf(szTitle, sizeof(szTitle), "VirtualBox Guest Additions Drag'n Drop");
    967                 RTStrPrintf(szMsg, sizeof(szMsg), "Drag'n drop to the host either is not supported or disabled. "
    968                                                   "Pleas enable Guest to Host or Bidirectional drag'n drop mode "
    969                                                   "or re-install the VirtualBox Guest Additions.");
    970                 switch (rc)
    971                 {
    972                     case VERR_ACCESS_DENIED:
    973                         rc = hlpShowBalloonTip(ghInstance, ghwndToolWindow, ID_TRAYICON,
    974                                                szMsg, szTitle,
    975                                                15 * 1000 /* Time to display in msec */, NIIF_INFO);
    976                         AssertRC(rc);
    977                         break;
    978 
    979                     default:
    980                         break;
    981                 }
     992                case VERR_ACCESS_DENIED:
     993                    rc = hlpShowBalloonTip(ghInstance, ghwndToolWindow, ID_TRAYICON,
     994                                           szMsg, szTitle,
     995                                           15 * 1000 /* Time to display in msec */, NIIF_INFO);
     996                    AssertRC(rc);
     997                    break;
     998
     999                default:
     1000                    break;
    9821001            }
    9831002        }
    984         else
    985             LogFlowFunc(("No format data available yet\n"));
    986     }
     1003    }
     1004
     1005    if (RT_FAILURE(rc))
     1006        reset(); /* Reset state on failure. */
    9871007
    9881008    LogFlowFuncLeaveRC(rc);
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