Apps Keep Opening Behind Other Windows Not in Focus
Apps open behind other windows and don't come to front. Here's the real fix and why it works.
I get it — you click a file or launch an app, and the window just hides behind everything else. You alt-tab and nothing. You click the taskbar icon and it stays there like it owns the place. It's not your PC being slow. It's Windows doing something dumb with focus.
The Real Fix: Disable Foreground Lock
Windows 10 and 11 both have a hidden setting called ForegroundLockTimeout. Microsoft added this to stop background apps from stealing focus while you're typing. Problem is, it also prevents legitimate apps from coming to the front when you want them to. Here's how to kill it.
- Press Win + R, type
regedit, hit Enter. - Go to:
HKEY_CURRENT_USER\Control Panel\Desktop - Find
ForegroundLockTimeout. Double-click it. - Change the value from
200000(default, in milliseconds — about 3 minutes) to0. - Click OK, close regedit, restart your PC.
Path: HKEY_CURRENT_USER\Control Panel\Desktop
Key: ForegroundLockTimeout
Value: 0 (decimal)
That's it. After the restart, every app you open or click will pop to the front immediately. No more hunting windows.
Why This Works
What's actually happening here is Windows is applying a timer. When an app tries to bring itself to the foreground, the system checks the ForegroundLockTimeout value. If the last foreground change was less than that many milliseconds ago, Windows says "no" and keeps the current window on top. By setting it to zero, we remove that timer entirely. Every app's request to come to the front is honored instantly.
The default of 200000ms (about 3 minutes) means if any app successfully set itself as foreground, all other apps are blocked from doing the same for 3 minutes. That's way too aggressive. It was meant to prevent pop-up ads from stealing focus, but it ends up blocking your own clicks. Turning it off doesn't break anything — apps still can't force themselves to the front unless you click them or they use the SetForegroundWindow API properly.
What About Taskbar Grouping?
If you've got multiple windows of the same app (like 3 Chrome windows) and Windows groups them on the taskbar, clicking the group just shows a menu of windows instead of bringing the last used one to front. That's a different issue. The fix is:
- Right-click the taskbar, select Taskbar settings.
- Find Combine taskbar buttons.
- Set it to Never (or When taskbar is full if you want some grouping).
This stops the group behavior entirely. Each app window gets its own taskbar button. Clicking it always brings that specific window to front. No more guessing.
Also Check: Focus Assist (Quiet Hours)
Windows 10 and 11 have a feature called Focus Assist (called Quiet Hours in older versions). When it's on, notifications are muted and apps are blocked from stealing focus. But it also stops apps from coming to the front when you click them. Go to Settings > System > Focus assist and make sure it's set to Off. If you use automatic rules (like during gaming), check that they're not accidentally blocking your work apps.
Note: Focus Assist used to be called Quiet Hours in Windows 10 1809 and earlier. Same thing, different name.
One More Thing: Mouse Click Behavior
Some apps, especially old ones or poorly written ones, don't respond to mouse clicks when they're behind another window. That's not a Windows issue — it's the app not handling the WM_MOUSEACTIVATE message properly. The fix for that is either update the app or run it in compatibility mode for Windows 7. Right-click the .exe, go to Properties > Compatibility, and check Run this program in compatibility mode for: Windows 7. This tricks the app into using the old focus behavior where any click brings it to front.
Prevention: Keep Focus Fast
Once you've applied the registry fix, you're set. But if you ever reset Windows or move to a new PC, you'll need to do it again. Save a .reg file somewhere like C:\Tools\fix-window-focus.reg with this content:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\Desktop]
"ForegroundLockTimeout"=dword:00000000
Double-click it and restart. That's it. Also avoid third-party focus managers (like some gaming overlays or window managers) — they often mess with the same setting and make things worse.
One last thing: this fix applies per user account. If you have multiple accounts on the same PC, each one needs the registry change. There's no global setting for this — Microsoft locked it to per-user for a reason (probably security).
Was this solution helpful?