VirtualBox

vbox的更動 61908 路徑 trunk/src/VBox/Main


忽略:
時間撮記:
2016-6-28 上午01:24:52 (8 年 以前)
作者:
vboxsync
訊息:

fix for ​​​​bugref:8441: improved windows procedures in Clipboard, DND and HostPowerWin.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Main/src-server/win/HostPowerWin.cpp

    r60052 r61908  
    5454        Log(("HostPowerServiceWin::!HostPowerServiceWin: destroy window %x\n", mHwnd));
    5555
    56         /* Is this allowed from another thread? */
    57         SetWindowLongPtr(mHwnd, 0, 0);
    5856        /* Poke the thread out of the event loop and wait for it to clean up. */
    59         PostMessage(mHwnd, WM_QUIT, 0, 0);
     57        PostMessage(mHwnd, WM_CLOSE, 0, 0);
    6058        RTThreadWait(mThread, 5000, NULL);
    6159        mThread = NIL_RTTHREAD;
     
    117115            MSG msg;
    118116            BOOL fRet;
    119             while ((fRet = GetMessage(&msg, NULL, 0, 0)) != 0)
     117            while ((fRet = GetMessage(&msg, NULL, 0, 0)) > 0)
    120118            {
    121                 if (fRet != -1)
    122                 {
    123                     TranslateMessage(&msg);
    124                     DispatchMessage(&msg);
    125                 }
    126                 else
    127                 {
    128                     // handle the error and possibly exit
    129                     break;
    130                 }
     119                TranslateMessage(&msg);
     120                DispatchMessage(&msg);
    131121            }
     122            /*
     123            * Window procedure can return error,
     124            * but this is exceptional situation
     125            * that should be identified in testing
     126            */
     127            Assert(fRet >= 0);
    132128        }
    133129    }
    134130
    135131    Log(("HostPowerServiceWin::NotificationThread: exit thread\n"));
    136     if (hwnd)
    137         DestroyWindow(hwnd);
    138132
    139133    if (atomWindowClass != 0)
     
    214208        }
    215209
     210        case WM_DESTROY:
     211        {
     212            /* moved here. it can't work across theads */
     213            SetWindowLongPtr(hwnd, 0, 0);
     214            PostQuitMessage(0);
     215            return 0;
     216        }
     217
    216218        default:
    217219            return DefWindowProc(hwnd, msg, wParam, lParam);
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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