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