From cfb0842726635e26de20e218b1ccd0680a237de1 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Wed, 4 May 2022 17:09:30 +0800 Subject: [PATCH] win: make sure we can still compile this project using some old windows sdks Signed-off-by: Yuhang Zhao <2546789017@qq.com> --- include/FramelessHelper/Core/framelesshelper_windows.h | 8 ++++++++ src/core/utils_win.cpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/FramelessHelper/Core/framelesshelper_windows.h b/include/FramelessHelper/Core/framelesshelper_windows.h index 489e2be..0e255c8 100644 --- a/include/FramelessHelper/Core/framelesshelper_windows.h +++ b/include/FramelessHelper/Core/framelesshelper_windows.h @@ -162,6 +162,14 @@ using MONITOR_DPI_TYPE = enum MONITOR_DPI_TYPE MDT_DEFAULT = MDT_EFFECTIVE_DPI }; +using _DWM_WINDOW_CORNER_PREFERENCE = enum _DWM_WINDOW_CORNER_PREFERENCE +{ + _DWMWCP_DEFAULT = 0, + _DWMWCP_DONOTROUND = 1, + _DWMWCP_ROUND = 2, + _DWMWCP_ROUNDSMALL = 3 +}; + EXTERN_C MMRESULT WINAPI timeGetDevCaps( _Out_writes_bytes_(cbtc) LPTIMECAPS ptc, diff --git a/src/core/utils_win.cpp b/src/core/utils_win.cpp index c04bf3a..df3d8a2 100644 --- a/src/core/utils_win.cpp +++ b/src/core/utils_win.cpp @@ -1329,7 +1329,7 @@ void Utils::forceSquareCornersForWindow(const WId windowId, const bool force) return; } const auto hwnd = reinterpret_cast(windowId); - const DWM_WINDOW_CORNER_PREFERENCE wcp = (force ? DWMWCP_DONOTROUND : DWMWCP_ROUND); + const _DWM_WINDOW_CORNER_PREFERENCE wcp = (force ? _DWMWCP_DONOTROUND : _DWMWCP_ROUND); const HRESULT hr = pDwmSetWindowAttribute(hwnd, _DWMWA_WINDOW_CORNER_PREFERENCE, &wcp, sizeof(wcp)); if (FAILED(hr)) { qWarning() << __getSystemErrorMessage(kDwmSetWindowAttribute, hr);