How to Stop Windows 11 from Automatically Changing the Active Window (Focus Stealing)

The Stolen Focus

One of the most infuriating behaviors in modern computing is “focus stealing.” This occurs when you are actively typing an email or writing code in one application, and a background program (like an updater, an antivirus scanner, or a chat client) suddenly forces its window to the absolute front of your screen, stealing your cursor and keyboard input. If you are typing quickly, you might inadvertently click a button or enter text into this new, unsolicited window before you even realize what has happened, potentially causing errors or initiating unwanted actions.

Locking the Foreground

To enforce a strict hierarchy where the application you are currently using always remains active, and to stop Windows 11 from automatically allowing background apps to steal focus, you must edit the system registry to block foreground lock timeouts.

Press the Windows Key, type regedit, and press Enter (click “Yes” on the User Account Control prompt). In the Registry Editor, carefully navigate through the left-hand folders to this exact path: HKEY_CURRENT_USER\Control Panel\Desktop. Click on the “Desktop” folder so its contents appear in the right-hand pane. Look for a registry value named ForegroundLockTimeout. Double-click it. Change the “Base” to Decimal, and enter the value data as 200000 (which translates to 200 seconds, effectively blocking the interruption). Click OK. Next, look for a value named ForegroundFlashCount. Double-click it, change the Base to Decimal, and set the value to 0. Click OK. Close the Registry Editor and restart your PC. Background apps will now only flash their icon on the taskbar when they need attention, rather than aggressively stealing your screen.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.