How to stop programs from stealing focus in Windows

Have you ever been annoyed by a program that appears in front of what you are doing, without you clicking or touching anything? In other words…. without your permission ?

It’s called steal focus , and it’s a lot like being bombed, right on your computer screen!

Sometimes focus stealing is due to malicious programming by the software[developer] that is doing it. Most of the time, though, it’s just faulty software or operating system behavior that you’ll need to pin down and try to fix or work around.

In early versions of Windows, especially Windows XP, there was actually a setting that allowed or prevented programs from stealing focus. See More about Focus Stealing in Windows XP below for troubleshooting steps.

Focus stealing was certainly a bigger problem in earlier versions of Windows like Windows XP, but it can and does happen in Windows 10, Windows 8, Windows 7, and Windows Vista as well.

How to stop programs from stealing focus in Windows

It’s not possible for Windows to block all programs from stealing focus and still work properly; it just isn’t built with the brain to understand it.

Ideally, no other program except the one you’re using should accept input from the mouse and keyboard, and the window should stay on top of all the others you’re not currently using.

The goal here is to identify the program that shouldn’t be doing this and then figure out what to do about it.

You may know which program keeps stealing focus, but if not, that’s the first thing you need to determine. If you’re having trouble understanding it, a free tool called Windows Focus Logger can help.

Once you know which program is to blame for stealing focus, work through the troubleshooting below to stop it from happening for good:

  1. Uninstall the offending program. Frankly, the easiest way to resolve a problem with a program that is stealing focus is to remove it.

    You can remove Windows programs from Control Panel with the Programs and Features applet, but free uninstall tools also work.

    If the focus stealing program is a background process, you can disable the process in Services, located in Administrative Tools in all versions of Windows. Free programs like CCleaner also provide easy ways to disable programs that start automatically with Windows.

  2. Reinstall the software program that is to blame. Assuming you need the program that’s stealing focus, and you’re not doing it maliciously, simply reinstalling it may fix the problem.

    If a newer version of the program is available, download that version to reinstall it. Software developers regularly issue patches for their programs, one of which may have been to prevent the program from stealing focus.

  3. Check the program options for settings that may be causing focus stealing and disable them. A software manufacturer may see a full-screen switch to their program as a “warning” feature that you want, but you see it as an unwanted interruption.
  4. Contact the software manufacturer and let them know that their program is stealing the focus. Provide as much information as you can about the situation(s) in which this occurs and ask them if they have a solution.

    Please read our How to Talk to Technical Support section for help in correctly reporting the issue.

  5. Last but not least, you can always try a third party anti-focus tool, of which there are a few:

    DeskPins is completely free and allows you to “pin” any window, keeping it above all others, no matter what. Studded windows are marked with a red pin and can be “self-nailed” depending on the title of the window.

    Window On Top is another free program that works in the same way. Simply drag your mouse pointer from Window On Top and drop it on a window so it stays on top. Or, press the hotkey Ctrl+F8 .

  6. Always On Top is one more portable program that is activated by the keyboard shortcut Ctrl+Space . Press those keys when the window is focused, and it will stay on top of any other windows until those keys are pressed again.

More information about Focus theft in Windows XP

As mentioned at the beginning of this article, Windows XP actually allows you to steal focus if a specific value in the Windows Registry is set in a specific way.

ForegroundLockTimeout DWORD (Windows XP).

By following the short tutorial below, you can manually change that value to the one that prevents programs from stealing focus in Windows XP.

Changes to the Windows Registry are made in these steps. Be very careful to make only the changes described below. It is recommended that you back up the registry keys that you are modifying in these steps as an additional precaution.

  1. Open Registry Editor.
  2. Locate the HKEY_CURRENT_USER hive under My Computer and click the plus sign (+) next to the folder name to expand it.
  3. Continue expanding the folders until you reach the HKEY_CURRENT_USERPanel registry key .
  4. Select the Desktop key under Control Panel .
  5. On the right side of the Registry Editor tool, locate and double-click the ForegroundLockTimeout DWORD.
  6. In the Edit DWORD Value window that appears, set the Value data: field to 30d40 .

    Make sure the Base option is set to Hexadecimal when you enter the DWORD value.

    Those are zeros in that value, not letters “o”. There is no ‘o’ in hexadecimal and so it would not be accepted, but it must be mentioned.

  7. Click OK and then close Registry Editor .
  8. Restart your computer for the changes you made to take effect.

From this point on, programs running on Windows XP should no longer steal focus from the window that is currently being worked on.

If you’re not comfortable making manual changes to the Windows Registry yourself, a program from Microsoft called Tweak UI can do it for you. You can download it for free here. Once installed, head over to Focus under the General area and check the box for Prevent apps from stealing focus .

Honestly, though, if you’re careful, the registration-based process explained above is perfectly safe and effective. You can always use the backup you made to restore the registry if things don’t work.

TechnoAdmin