From b57da216e9b87d97623f7facff82962c4c05f39b Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Sat, 22 Jul 2023 14:26:25 +0800 Subject: [PATCH] win: minor tweaks --- src/core/utils_win.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/utils_win.cpp b/src/core/utils_win.cpp index 7fd771f8..36a9466a 100644 --- a/src/core/utils_win.cpp +++ b/src/core/utils_win.cpp @@ -2501,6 +2501,14 @@ bool Utils::isValidWindow(const WId windowId, const bool checkVisible, const boo if (::IsWindow(hwnd) == FALSE) { return false; } + const LONG_PTR styles = ::GetWindowLongPtrW(hwnd, GWL_STYLE); + if ((styles == 0) || (styles & WS_DISABLED)) { + return false; + } + const LONG_PTR exStyles = ::GetWindowLongPtrW(hwnd, GWL_EXSTYLE); + if (exStyles & WS_EX_TOOLWINDOW) { + return false; + } RECT rect = { 0, 0, 0, 0 }; if (::GetWindowRect(hwnd, &rect) == FALSE) { return false;