Index: /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp	(revision 81131)
+++ /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp	(revision 81132)
@@ -1138,11 +1138,45 @@
         case WM_VBOXTRAY_TRAY_ICON:
         {
-            switch (lParam)
+            switch (LOWORD(lParam))
             {
                 case WM_LBUTTONDBLCLK:
                     break;
-
+#ifdef DEBUG
                 case WM_RBUTTONDOWN:
+                {
+                    POINT lpCursor;
+                    if (GetCursorPos(&lpCursor))
+                    {
+                        HMENU hContextMenu = CreatePopupMenu();
+                        if (hContextMenu)
+                        {
+                            UINT_PTR uMenuItem = 9999;
+                            UINT     fMenuItem = MF_BYPOSITION | MF_STRING;
+                            if (InsertMenuW(hContextMenu, UINT_MAX, fMenuItem, uMenuItem, L"Exit"))
+                            {
+                                SetForegroundWindow(hWnd);
+
+                                const bool fBlockWhileTracking = true;
+
+                                UINT fTrack = TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_BOTTOMALIGN;
+
+                                if (fBlockWhileTracking)
+                                    fTrack |= TPM_RETURNCMD | TPM_NONOTIFY;
+
+                                UINT uMsg = TrackPopupMenu(hContextMenu, fTrack, lpCursor.x, lpCursor.y, 0, hWnd, NULL);
+                                if (   uMsg
+                                    && fBlockWhileTracking)
+                                {
+                                    if (uMsg == uMenuItem)
+                                        PostMessage(g_hwndToolWindow, WM_QUIT, 0, 0);
+                                }
+                                else if (!uMsg)
+                                    LogFlowFunc(("Tracking popup menu failed with %ld\n", GetLastError()));
+                            }
+                        }
+                    }
                     break;
+                }
+#endif
             }
             return 0;
