From 2e2c019204c0da58e26c69cce90b31d4e5e98213 Mon Sep 17 00:00:00 2001 From: York Waugh <67750590+YorkWaugh@users.noreply.github.com> Date: Mon, 9 Sep 2024 22:43:08 +0800 Subject: [PATCH] chore: improve boss key logic to avoid hiding other windows with similar class names (#104) Close #100 --- src/hotkey.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hotkey.h b/src/hotkey.h index 248e5f9..c0fb3bf 100644 --- a/src/hotkey.h +++ b/src/hotkey.h @@ -71,8 +71,12 @@ BOOL CALLBACK SearchChromeWindow(HWND hWnd, LPARAM lParam) { 0) // || wcscmp(buff, L"Chrome_WidgetWin_2")==0 || wcscmp(buff, // L"SysShadow")==0 ) { - ShowWindow(hWnd, SW_HIDE); - hwnd_list.push_back(hWnd); + DWORD pid; + GetWindowThreadProcessId(hWnd, &pid); + if (pid == GetCurrentProcessId()) { + ShowWindow(hWnd, SW_HIDE); + hwnd_list.push_back(hWnd); + } } } return true;