win: make sure we can still compile this project using some old windows sdks

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2022-05-04 17:09:30 +08:00
parent 9d71baffd1
commit cfb0842726
2 changed files with 9 additions and 1 deletions

View File

@ -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,

View File

@ -1329,7 +1329,7 @@ void Utils::forceSquareCornersForWindow(const WId windowId, const bool force)
return;
}
const auto hwnd = reinterpret_cast<HWND>(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);