Win32Utils.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef WIN32UTILS_H
  2. #define WIN32UTILS_H
  3. #include <QGuiApplication>
  4. #include <QOperatingSystemVersion>
  5. #include <Windows.h>
  6. namespace Win32Utils
  7. {
  8. bool isMaximized(HWND hWnd);
  9. bool isFullScreen(HWND hWnd);
  10. bool getMonitorInfo(HWND hWnd, DWORD dwFlags, LPMONITORINFO lpmi);
  11. int getResizeBorderThickness(HWND hWnd, bool horizontal = true);
  12. QWindow *findWindow(HWND hWnd);
  13. bool isGreaterEqualVersion(QOperatingSystemVersion version);
  14. bool isWin7();
  15. bool isGreaterEqualWin8_1();
  16. bool isGreaterEqualWin10();
  17. bool isGreaterEqualWin11();
  18. class Taskbar
  19. {
  20. public:
  21. enum Position
  22. {
  23. LEFT = 0,
  24. TOP,
  25. RIGHT,
  26. BOTTOM,
  27. NO_POSITION
  28. };
  29. static const int AUTO_HIDE_THICKNESS = 2;
  30. static bool isAutoHide();
  31. static Position getPosition(HWND hWnd);
  32. };
  33. /**
  34. * @brief Tool class for moving and resizing Mac OS window
  35. */
  36. class WindowsMoveResize
  37. {
  38. public:
  39. static void startSystemMove(QWidget *window, QPoint globalPos);
  40. static void starSystemResize(QWidget *window, QPoint globalPos, Qt::Edges edges);
  41. };
  42. }; // namespace Win32Utils
  43. #endif // WIN32UTILS_H