mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
[FancyZones] Bypass restriction on SetForegroundWindow (#14383)
Co-authored-by: float4 <float4-unspecified-mail>
This commit is contained in:
@@ -594,19 +594,17 @@ ZoneSet::CycleTabs(HWND window, bool reverse) noexcept
|
||||
for (;;)
|
||||
{
|
||||
auto next = GetNextTab(indexSet, window, reverse);
|
||||
if (next == NULL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
auto success = SetForegroundWindow(next);
|
||||
if (!success && GetLastError() == ERROR_INVALID_WINDOW_HANDLE)
|
||||
// Determine whether the window still exists
|
||||
if (!IsWindow(next))
|
||||
{
|
||||
// Dismiss the encountered window since it was probably closed
|
||||
DismissWindow(next);
|
||||
continue;
|
||||
}
|
||||
|
||||
SwitchToWindow(next);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user