If we don't want a message to be processed by Qt, return true and set result to the value that the window procedure should return. Otherwise return false.
| 14 | // If we don't want a message to be processed by Qt, return true and set result to |
| 15 | // the value that the window procedure should return. Otherwise return false. |
| 16 | bool WinShutdownMonitor::nativeEventFilter(const QByteArray &eventType, void *pMessage, long *pnResult) |
| 17 | { |
| 18 | Q_UNUSED(eventType); |
| 19 | |
| 20 | MSG *pMsg = static_cast<MSG *>(pMessage); |
| 21 | |
| 22 | switch(pMsg->message) |
| 23 | { |
| 24 | case WM_QUERYENDSESSION: |
| 25 | { |
| 26 | // Initiate a client shutdown after receiving a WM_QUERYENDSESSION and block |
| 27 | // Windows session end until we have finished client shutdown. |
| 28 | StartShutdown(); |
| 29 | *pnResult = FALSE; |
| 30 | return true; |
| 31 | } |
| 32 | |
| 33 | case WM_ENDSESSION: |
| 34 | { |
| 35 | *pnResult = FALSE; |
| 36 | return true; |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | return false; |
| 41 | } |
| 42 | |
| 43 | void WinShutdownMonitor::registerShutdownBlockReason(const QString& strReason, const HWND& mainWinId) |
| 44 | { |
nothing calls this directly
no test coverage detected