Preventing Outlook (and other programs) from stealing focus

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.

Description

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.

Solution

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:

  1. Open regedit (win+r, write regedit, or just search for regedit in Start menu).
  2. Export your registry to make a backup before making changes!
  3. Browse to HKEY_CURRENT_USER > Control Panel > Desktop..
  4. Edit ForegroundLockTimeout (see below) to be 0 instead of whatever there is.
Regedit before changes stopping Outlook from stealing focus

Regedit before changes stopping Outlook from stealing focus.

Regedit after changes stopping Outlook from stealing focus

Regedit after changes stopping Outlook from stealing focus.

 

And that’s it! You should be good. 

The following two tabs change content below.

Antti K. Koskela

Solutions Architect / Escalations Engineer at Koskila / Norppandalotti Software / Valo Solutions
Antti Koskela is a proud digital native nomadic millenial full stack developer (is that enough funny buzzwords? That's definitely enough funny buzzwords!), who works as a Solutions Architect for Valo Intranet, the product that will make you fall in love with your intranet. Working with the global partner network, he's responsible for the success of Valo deployments happening all around the world. He's been a developer from 2004 (starting with PHP and Java), and he's been bending and twisting SharePoint into different shapes since MOSS. Nowadays he's not only working on SharePoint, but also on .NET projects, Azure, Office 365 and a lot of other stuff.This is his personal professional (e.g. professional, but definitely personal) blog.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.