You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

winshutdownmonitor.h 921B

1234567891011121314151617181920212223242526272829
  1. // Copyright (c) 2014 The Starwels developers
  2. // Distributed under the MIT software license, see the accompanying
  3. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  4. #ifndef STARWELS_QT_WINSHUTDOWNMONITOR_H
  5. #define STARWELS_QT_WINSHUTDOWNMONITOR_H
  6. #ifdef WIN32
  7. #include <QByteArray>
  8. #include <QString>
  9. #if QT_VERSION >= 0x050000
  10. #include <windef.h> // for HWND
  11. #include <QAbstractNativeEventFilter>
  12. class WinShutdownMonitor : public QAbstractNativeEventFilter
  13. {
  14. public:
  15. /** Implements QAbstractNativeEventFilter interface for processing Windows messages */
  16. bool nativeEventFilter(const QByteArray &eventType, void *pMessage, long *pnResult);
  17. /** Register the reason for blocking shutdown on Windows to allow clean client exit */
  18. static void registerShutdownBlockReason(const QString& strReason, const HWND& mainWinId);
  19. };
  20. #endif
  21. #endif
  22. #endif // STARWELS_QT_WINSHUTDOWNMONITOR_H