#347, avoid invoke webpage commander window when pressing hotkey on taskbar

This commit is contained in:
Kang Yu 2024-08-14 17:49:48 -07:00
parent 3240042a68
commit 2a7a108748
2 changed files with 9 additions and 4 deletions

View file

@ -2125,8 +2125,11 @@ namespace PersistentWindows.Common
return fixZorder == 2 || (restoringSnapshot && fixZorder > 0);
}
public static IntPtr GetForegroundWindow()
public static IntPtr GetForegroundWindow(bool strict = false)
{
if (strict)
return User32.GetForegroundWindow();
IntPtr topMostWindow = User32.GetTopWindow(desktopWindow);
for (IntPtr hwnd = topMostWindow; hwnd != IntPtr.Zero; hwnd = User32.GetWindow(hwnd, 2))
{