#SharePointProblems | Koskila.net

Solutions are worthless unless shared! Antti K. Koskela's Personal Professional Blog
>

How to prevent Outlook and other programs from stealing focus

koskila
Reading Time 3 min
Word Count 458 words
Comments 9 comments
Rating 3.2 (6 votes)
View

Imagine being deeply focused on a very important and time-sensitive task and, all of a sudden, an incoming email throws you off by jumping into focus. I am sure you don't need to imagine too hard as this has likely annoyed you in the recent past too, right?

Here is a guide to help you make sure that no piece of software has the ability to "jump to the top" and activate your cursor on it, letting you carry on working on that important task without taking your focus away.

Problem

So, what did I run into, again? Let's see!

Here's a bit of context...

After a recent batch of Windows updates, my Outlook desktop client started stealing focus whenever a new email hit my inbox. Like most people, I get a lot of emails, and after a while my patience completely ran out when Outlook kept jumping into focus, stealing my keystrokes, and actioning whatever those keystrokes were bound to do in Outlook.

Whether or not broken updates should be pushed to end-users is an entirely different story, but let's not go there right now.

Why and when does stealing focus happen?

Any time Outlook shows a notification for new mail, the window would also steal focus. Having already disabled practically all of the notifications from the Windows 10 Notification Center, this should not have been the case. However, the issue still persisted despite this.

After Googling did not yield any decent solutions, the best advice that I found was to disable all Outlook add-ins, but even that did not resolve the issue.

I did not find a suitable solution for Outlook alone, but luckily I found a way to disable all applications from having the ability to steal focus altogether. In my opinion, this is a definite win as no application should ever be able to jump to focus anyway.

Here is the workaround that I used.

Solution

This solution is outlined in this conversation. To stop the issue, we need to set the registry key for Foreground Lock Timeout to 0, effectively stopping that timeout from ever expiring. Below are the steps with a few screenshots to guide you through the process.

How to prevent Outlook and other programs from stealing focus

Time needed: 5 minutes.

  1. Open regedit (win+r, write regedit, or just search for "regedit" in Start Menu).

  2. Export your registry in order to make a backup before making any changes.

  3. Browse to HKEY_CURRENT_USER > Control Panel > Desktop.

  4. Edit ForegroundLockTimeout (see below) to "0" instead of whatever value is stated.

    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 can enjoy doing that task without any more annoying Outlook notifications stealing focus.

Comments

Interactive comments not implemented yet. Showing legacy comments migrated from WordPress.
HOMEiA
2019-06-23 08:48:33)
This is a fantastic blog. Thanks for sharing,
Michael Vandine
2019-10-12 22:49:34)
Thanks so much! I've been struggling with this for ages and Microsoft was absolutely no help!!
2019-10-13 05:28:23
Hi Michael, Thanks for your comment! Happy to hear it helped :)
dg54321
2019-10-25 09:50:26)
Unfortunately no longer works. Mine is set to 0 and CONSTANTLY Outlook 2019 pops up and steals focus. Incredibly annoying. And I've found no fix. Thanks anyways though for the try...I assume it works for other programs since no other one steals focus like this. Leave it to Microsoft to ignore it's own registry settings and do whatever it wants....
2019-10-28 08:58:29
Huh - the hack hasn't stopped working for me so far, but perhaps it will after another future update... 😬 I've been transitioning towards only using Outlook web, since there's so little email I need to send nowadays, and even the calendar is now in Teams... Maybe the annoyances of Outlook are just a way to push people towards adopting Teams? :P
asdf
2021-11-18 13:48:04)
Sorry if raised before - this implies that you have admin rights. I use AHK at work and have to clear Outlook calendar and emails of all meetings and restart Outlook in order to for focus to behave normally
Antti K. Koskela
2021-11-26 11:12:29
You'd be correct. That sounds like a pretty elegant solution! You wouldn't want to share your script? :D
Mike
2022-11-03 17:13:37)
`Initially this worked, then reverted to its original, annoying behaviour the next day. Registry key values had not changed. I tried changing all instance of the ForegroundLockTimeout key to 0 bit to no avail. All users still had the unwanted behaviour.
Antti K. Koskela
2022-11-29 14:38:51
Ah, hmm. That's annoying - I think for me, the issue didn't come back, and I can't even reproduce it since I don't have the machine anymore. Is it Outlook in Windows 10 causing the issue for you, too?