Index: /trunk/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp
===================================================================
--- /trunk/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp	(revision 61919)
+++ /trunk/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp	(revision 61920)
@@ -1229,6 +1229,9 @@
             }
             break;
-        case WM_DESTROY:
-            return 0;
+         case WM_DESTROY:
+            {
+                PostQuitMessage(0);
+                return 0;
+            }
     }
     return DefWindowProc (hwnd, uMsg, wParam, lParam);
@@ -1283,14 +1286,11 @@
          */
         MSG msg;
-        while (GetMessage(&msg, NULL, 0, 0))
+        BOOL fRet;
+        while ((fRet = GetMessage(&msg, NULL, 0, 0)) > 0)
         {
             TranslateMessage(&msg);
             DispatchMessage(&msg);
         }
-
-        /*
-         * Clean up.
-         */
-        DestroyWindow(g_VBoxUsbGlobal.hWnd);
+        Assert(fRet >= 0);
     }
 
@@ -1554,5 +1554,5 @@
     BOOL bRc;
 #ifdef VBOX_USB_USE_DEVICE_NOTIFICATION
-    bRc = PostMessage(g_VBoxUsbGlobal.hWnd, WM_QUIT, 0, 0);
+    bRc = PostMessage(g_VBoxUsbGlobal.hWnd, WM_CLOSE, 0, 0);
     AssertMsg(bRc, ("PostMessage for hWnd failed winEr(%d)\n", GetLastError()));
 
