How to Prevent Programs From Stealing Focus in Windows

It's easy to stop programs from popping up in front of other ones

Ever been annoyed by a program that pops up in front of what you're doing, without you selecting anything? In other words...without your permission?

It's called stealing focus, and it's a lot like being photobombed, right on your computer screen!

Sometimes focus stealing is due to malicious programming by the software developer that's doing it. Most of the time, however, it's just buggy software or operating system behavior that you'll need to pin down and try to fix or avoid.

In early versions of Windows, most notably in Windows XP, there was actually a setting that either allowed or prevented programs from stealing focus. See More on Stealing Focus in Windows XP below the troubleshooting steps.

Focus stealing was certainly more of a problem in older 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 Prevent Programs From Stealing Focus in Windows

It's not possible for Windows to block all programs from stealing focus and still work properly—it's just not built with the brains to understand that.

Ideally, no other program but the one you're working in would accept mouse and keyboard input, and the window would stay on top of all the other ones 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 what program keeps stealing focus, but if not, that's the first thing you need to determine. If you're having trouble figuring it out, a free tool called Window Focus Logger can help.

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

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

    You can remove programs in Windows from Control Panel with the Programs & Features applet, but free uninstaller tools work as well.

    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's to blame. Assuming you need the program that's stealing focus, and it isn't doing so maliciously, simply reinstalling it may fix the problem.

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

  3. Check the program's options for settings that may be causing the focus stealing, and disable them. A software maker may see a full screen switch to his or her program as an "alert" feature that you want, but you see it as an unwelcome interruption.

  4. Contact the software maker and let them know that their program is stealing focus. Give as much information as you can about the situation(s) where this occurs and ask if they have a fix.

    Read through our How to Talk to Tech Support for help properly communicating the problem.

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

    • DeskPins is completely free and lets you "pin" any window, keeping it on top of all others, no matter what. Pinned windows are marked with a red pin and can be "auto-pinned" based on the window's title.
    • Window On Top is another free program that works in much the same way. Drag the mouse pointer from Window On Top and drop it on a window to make it stay on top. Or, hit the Ctrl+F8 hotkey.
  6. Windows should now stop stealing focus while you're not using them.

More on Stealing Focus in Windows XP

As mentioned at the start of this piece, Windows XP actually allowed for focus stealing if one specific value in the Windows Registry was set in a specific way.

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. Take great care in making only the changes described below. It's recommended that you back up the registry keys you're modifying in these steps as an extra precaution.

  1. Open Registry Editor.

  2. Locate the HKEY_CURRENT_USER hive under My Computer and select the (+) sign next the folder name to expand the folder.

  3. Continue to expand folders until you reach the HKEY_CURRENT_USER\Control Panel registry key.

  4. Select the Desktop key under Control Panel.

  5. On the right-hand side of the Registry Editor tool, locate and double-click the ForegroundLockTimeout DWORD.


    ForegroundLockTimeout DWORD in the Windows XP registry


    Those are zeros in that value, not 'o' letters. Hexadecimal doesn't include the letter o and so they wouldn't be accepted, but it should be mentioned nonetheless.

  7. Select OK and then close Registry Editor.

  8. Restart your computer so the changes you made can take effect.

From this point forward, programs you run in Windows XP should no longer steal the focus from the window that you're currently working in.

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. Once installed, head to Focus under the General area and check the box to Prevent applications from stealing focus.

Honestly, though, if you're careful, the registry-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 out.

Was this page helpful?