This post describes how to stop Windows applications from stealing focus from each other. In a practical sense, no piece of software should be able to “jump” to the top and activate your cursor in it, after the steps in this blog post have been applied.
After some recent batch of Windows updates my Outlook desktop client started stealing focus whenever there was a new email coming in. Like most people, I get a lot of email, and after a while my humor completely ran out with Outlook jumping in, stealing my keystrokes and doing whatever those keystrokes were bound to in Outlook.
Okay, it’s worth another post, whether broken updates should be pushed to end-users, but let’s not go there.
Some quick googling did not yield any good solutions for me. The best that was given to Outlook alone was to disable all add-ins, but that did not do the trick.
I did not find a suitable solution for just Outlook, but luckily that doesn’t stop us from disabling ALL APPS from stealing focus altogether! And to me, that’s not bad. No app should be jumping around frantically anyway.
Why and when does stealing focus happen?
At least in my case, it was fairly simple. Any time Outlook would show a notification for new mail, the window also stole focus. I already disabled practically all of the notifications from Windows 10 Notification Center, but that did not help. The darn window was still popping up constantly when I was doing something else.
This solution was outlined in this conversation. We’ll be setting the registry key for Foreround Lock Timeout to 0, effectively stopping that timeout from ever expiring. Down below the steps with a few screenshots:
- Open regedit (win+r, write regedit, or just search for regedit in Start menu).
- Export your registry to make a backup before making changes!
- Browse to HKEY_CURRENT_USER > Control Panel > Desktop..
- Edit ForegroundLockTimeout (see below) to be 0 instead of whatever there is.
And that’s it! You should be good.
Latest posts by Antti K. Koskela (see all)
- Thanks for coming to my session at SPS New England 10/20 ! - October 20, 2018
- Speaking at SPS New England on 10/20! - October 17, 2018
- Ignite 2018 recap: What’s new for Azure Functions? - October 16, 2018
- Problematic behavior of web.AddSupportedUILanguage(int lcid) in SharePoint 2013 and 2016 - October 10, 2018