From 9958dd0cea0c69c78ca73020a3f056f1f0f619b2 Mon Sep 17 00:00:00 2001 From: SimplestStudio Date: Sat, 14 Sep 2024 06:59:02 +0300 Subject: [PATCH] [win] online-installer: fix top border width for win10 --- .../extras/online-installer/src/uiclasses/window.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/win-linux/extras/online-installer/src/uiclasses/window.cpp b/win-linux/extras/online-installer/src/uiclasses/window.cpp index 4e9e8c8a3..6add8ebbc 100644 --- a/win-linux/extras/online-installer/src/uiclasses/window.cpp +++ b/win-linux/extras/online-installer/src/uiclasses/window.cpp @@ -149,7 +149,9 @@ Window::Window(Widget *parent, const Rect &rc) : GetFrameMetricsForDpi(m_frame, m_dpi, m_isMaximized); if (m_borderless && Utils::getWinVersion() == WinVer::Win10) { - SystemParametersInfo(SPI_GETBORDER, 0, &m_brdWidth, 0); + HDC hdc = GetDC(NULL); + m_brdWidth = GetSystemMetrics(SM_CXBORDER) * GetDeviceCaps(hdc, LOGPIXELSX)/96; + ReleaseDC(NULL, hdc); m_brdColor = Utils::getColorizationColor(true, RGB(0xfe, 0xfe, 0xfe)); } SetWindowPos(m_hWnd, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED); @@ -443,7 +445,9 @@ bool Window::event(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *result) if (isMaximized) { m_brdWidth = 0; } else { - SystemParametersInfo(SPI_GETBORDER, 0, &m_brdWidth, 0); + HDC hdc = GetDC(NULL); + m_brdWidth = GetSystemMetrics(SM_CXBORDER) * GetDeviceCaps(hdc, LOGPIXELSX)/96; + ReleaseDC(NULL, hdc); } } }