Changeset 46775 in vbox for trunk/src/VBox/Main/src-server/win
- Timestamp:
- Jun 25, 2013 12:37:57 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86706
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/win/HostPowerWin.cpp
r46722 r46775 5 5 6 6 /* 7 * Copyright (C) 2006-201 0Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 36 36 mHwnd = 0; 37 37 38 int rc = RTThreadCreate 39 38 int rc = RTThreadCreate(&mThread, HostPowerServiceWin::NotificationThread, this, 65536, 39 RTTHREADTYPE_GUI, RTTHREADFLAGS_WAITABLE, "MainPower"); 40 40 41 41 if (RT_FAILURE(rc)) … … 63 63 64 64 65 DECLCALLBACK(int) HostPowerServiceWin::NotificationThread 65 DECLCALLBACK(int) HostPowerServiceWin::NotificationThread(RTTHREAD ThreadSelf, void *pInstance) 66 66 { 67 67 HostPowerServiceWin *pPowerObj = (HostPowerServiceWin *)pInstance; … … 71 71 int rc = VINF_SUCCESS; 72 72 73 HINSTANCE hInstance = (HINSTANCE)GetModuleHandle 73 HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL); 74 74 75 75 /* Register the Window Class. */ … … 97 97 { 98 98 /* Create the window. */ 99 hwnd = pPowerObj->mHwnd = CreateWindowEx 100 101 102 99 hwnd = pPowerObj->mHwnd = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TRANSPARENT | WS_EX_TOPMOST, 100 gachWindowClassName, gachWindowClassName, 101 WS_POPUPWINDOW, 102 -200, -200, 100, 100, NULL, NULL, hInstance, NULL); 103 103 104 104 if (hwnd == NULL) … … 124 124 Log(("HostPowerServiceWin::NotificationThread: exit thread\n")); 125 125 if (hwnd) 126 DestroyWindow 126 DestroyWindow(hwnd); 127 127 128 128 if (atomWindowClass != 0) 129 129 { 130 UnregisterClass 130 UnregisterClass(gachWindowClassName, hInstance); 131 131 atomWindowClass = 0; 132 132 } … … 149 149 { 150 150 case PBT_APMSUSPEND: 151 pPowerObj->notify( HostPowerEvent_Suspend);151 pPowerObj->notify(Reason_HostSuspend); 152 152 break; 153 153 154 154 case PBT_APMRESUMEAUTOMATIC: 155 pPowerObj->notify( HostPowerEvent_Resume);155 pPowerObj->notify(Reason_HostResume); 156 156 break; 157 157 … … 180 180 && BatteryState.EstimatedTime < 60*5) 181 181 { 182 pPowerObj->notify( HostPowerEvent_BatteryLow);182 pPowerObj->notify(Reason_HostBatteryLow); 183 183 } 184 184 } … … 187 187 if (SystemPowerStatus.BatteryFlag == 4 /* critical battery status; less than 5% */) 188 188 { 189 pPowerObj->notify( HostPowerEvent_BatteryLow);189 pPowerObj->notify(Reason_HostBatteryLow); 190 190 } 191 191 } … … 194 194 } 195 195 default: 196 return DefWindowProc 196 return DefWindowProc(hwnd, msg, wParam, lParam); 197 197 } 198 198 } … … 201 201 202 202 default: 203 return DefWindowProc 204 } 205 } 203 return DefWindowProc(hwnd, msg, wParam, lParam); 204 } 205 }
Note:
See TracChangeset
for help on using the changeset viewer.