5 #ifndef BITCOIN_QT_WINSHUTDOWNMONITOR_H 6 #define BITCOIN_QT_WINSHUTDOWNMONITOR_H 15 #include <QAbstractNativeEventFilter> 17 class WinShutdownMonitor :
public QAbstractNativeEventFilter
20 WinShutdownMonitor(std::function<
void()> shutdown_fn) : m_shutdown_fn{std::move(shutdown_fn)} {}
23 bool nativeEventFilter(
const QByteArray &eventType,
void *pMessage,
long *pnResult)
override;
26 static void registerShutdownBlockReason(
const QString& strReason,
const HWND& mainWinId);
29 std::function<void()> m_shutdown_fn;
33 #endif // BITCOIN_QT_WINSHUTDOWNMONITOR_H