bool UIDirect3D9Window::winEvent(MSG *Message, long *Result) { // certain events are filtered out by Qt and are never passed on // (e.g. WM_QUERYENDSESSION/ENDSESSION) // TODO WM_MEDIA_CHANGE if (!Message || !Result) return false; switch (Message->message) { // see comments in libs/libtorc-core/platforms/torcpowerwin.cpp case WM_POWERBROADCAST: // we really only want to handle this once and these two events // should cover all eventualities - hence we do not explicitly // handle PBT_APMRESUMESUSPEND or PBT_APMRESUMESTANDBY if (Message->wParam == PBT_APMRESUMEAUTOMATIC || Message->wParam == PBT_APMRESUMECRITICAL) { gPower->WokeUp(); } else if (Message->wParam == PBT_APMSUSPEND || Message->wParam == PBT_APMSTANDBY) { gPower->Suspending(); } else if (Message->wParam == PBT_APMQUERYSTANDBYFAILED || Message->wParam == PBT_APMQUERYSUSPENDFAILED) { // TODO this may need to be handled properly LOG(VB_GENERAL, LOG_WARNING, "System suspension failed"); } else if (Message->wParam == PBT_APMQUERYSTANDBY || Message->wParam == PBT_APMQUERYSUSPEND) { LOG(VB_GENERAL, LOG_INFO, "Received suspend/standby query"); } else if (Message->wParam == PBT_APMPOWERSTATUSCHANGE) { gPower->Refresh(); } break; case WM_INPUT: return HandleRawInput(Message, Result); break; case WM_APPCOMMAND: return HandleAppCommand(Message, Result); break; case WM_DEVICECHANGE: gLocalContext->NotifyEvent(Torc::USBRescan); break; default: break; } return false; }
LRESULT DesktopWindowing::HandleMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) const { switch (uMsg) { case WM_DESTROY: case WM_QUIT: Input::GetInstance().Quit(); return 0; case WM_INPUT: return HandleRawInput(wParam, lParam); default: return DefWindowProc(hWnd, uMsg, wParam, lParam); } }