Prevent applications from stealing focus

Martin Brinkmann
Apr 4, 2008
Updated • Oct 3, 2015
Windows, Windows tips

Have you ever noticed that applications may steal the focus while you are working on your system? This can happen for a number of reasons, when you are extracting files for instance or transfers finish, or when an application displays a notification on the screen that is automatically pushed to the foreground.

Most of the time it is not really an issue, for instance when you are watching a video as it does not stop you from watching it. Sometimes however it happens when I'm typing, writing an article for Ghacks for instance and when that happens, some of the text that I'm writing is no longer added to the text editor or browser, but sent to the application that stole focus on the system.

When I realize that I have to click back on the window I was working on, re-read the last sentence or two to understand it, retype the words that were not recorded due to the focus issue, and continue writing from then on out.

The easiest way of preventing focus stealing is to use Tweak UI which has a setting that is called "Prevent applications from stealing focus". Checking this option prevents that other applications pop up suddenly and steal the focus of the window you are currently working in.

This only works when the application has been minimized before. Instead of stealing the focus it will flash a number of times which can be defined in the same menu in Tweak UI. If you do not want to use Tweak UI you can change the setting in the Windows Registry.

Press Windows-r to open up the runbox, enter regedit here and tap on the enter key. Navigate to the Registry key HKEY_CURRENT_USER > Control Panel > Desktop and change the ForegroundLockTimeout value to 30d40 (Hexadecimal) or 200000 (Decimal). The key ForeGroundFlashCount defines the amount of flashes of a window to alert the user where 0 means unlimited.

Update: Microsoft seems to have resolved the situation under Windows 7 apparently, where applications are less likely to steal focus.

Prevent applications from stealing focus
Article Name
Prevent applications from stealing focus
Block applications from stealing focus while you are working on a PC running the Windows operating system.

Tutorials & Tips

Previous Post: «
Next Post: «


  1. a said on May 10, 2010 at 1:45 am

    This does not work. Please stop joining others in flooding the internet with this garbage. It is stealing our focus while we try to look for a solution that actually works.

  2. Fak said on December 9, 2009 at 10:53 pm

    Even after doing that, Firefox still steals focus.
    For instance, when I’m on a chat, it pops up every time a get a message.

  3. Salz` said on March 15, 2009 at 12:50 pm

    Is there an “harder” way, like preventing focus steal by “You need to restart” dialogs, it realy sucks if you write an article and confirm the dialog with the spacebar. *grml*

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.