MCPcopy Create free account
hub / github.com/ElementsProject/elements / nativeEventFilter

Method nativeEventFilter

src/qt/winshutdownmonitor.cpp:16–41  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
16bool 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
43void WinShutdownMonitor::registerShutdownBlockReason(const QString& strReason, const HWND& mainWinId)
44{

Callers

nothing calls this directly

Calls 1

StartShutdownFunction · 0.85

Tested by

no test coverage detected