7

Some applications, when being installed, updated or opened, tend to force themselves in the foreground. When another application is in the foreground already, like in the worst case, a game in full screen mode, Windows switches out of that application to display the app forcing itself into the foreground.

Is there a way to prevent an app from making itself active / selected / in the foreground? Ideally, it'd stay minimized in the task bar until I manually bring it up.

towe
  • 116

2 Answers2

4

There is no cure-all solution, since there is no way that Windows can totally block applications from stealing the focus and itself remain functional. For example, if during a file-copy your anti-virus detected a possible threat and would like to pop-up a window asking you for the action to take, if this window is blocked then you would never understand why the copy suddenly froze.

If the problem is with some unknown focus stealer, a good tool for detecting the stealer is with the free Window Focus Logger (use the GUI version WindowFocusLoggerGUI.exe).

Once the focus thief is identified, there are several solutions:

  • Prevent it from running in the first place
  • Update it to a newer version that is better behaved
  • Enable focus-follows-mouse so the focus stays in your application (unless the focus stealer jumps in front of the cursor).
    This is done in Control Panel > Ease of Access Center > Make the mouse easier to use, check "Activate a window by hovering over it with the mouse" and click OK.
  • Minimize it using a stronger method than minimize to the taskbar.

The last method is by minimizing the offending window to the System Tray, also known as the Notification Area, where only the software that minimized it can undo it. An example for such a product is 4t Tray Minimizer Free.

harrymc
  • 498,455
3

I found references stating this is not possible, and at the same time there seems to be a solution:

  1. Start the Registry Editor (Windows button + R, then type regedit)
  2. Search for HKEY_CURRENT_USER\Control Panel\Desktop\ForegroundLockTimeout
  3. Change the value from 0 to 30d40
  4. Save and restart the computer

I am on Ubuntu now so I cannot test if it works in Windows 10 (perhaps this is what you were referring to in a comment). Strangely, some report that it works and some that it doesn't. YMMV.

In addition, this and others suggest applications aimed at this, although I am not clear they serve your intended purpose...

  1. Deskpins
  2. Window On Top
  3. Actual Windows Manager

Related

  1. https://en.wikipedia.org/wiki/Focus_stealing
  2. https://social.technet.microsoft.com/Forums/en-US/c22363e5-802c-4f43-b4e3-8a7259865648/windows-10-stop-any-application-from-stealing-focus-ever-is-it-possible?forum=win10itprogeneral#123b4fea-0a57-491d-bdfa-a5ee0771f2de
  3. https://www.lifewire.com/how-to-prevent-programs-from-stealing-focus-in-windows-2624453
  4. https://answers.microsoft.com/en-us/windows/forum/windows_7-desktop/windows-7-how-to-stop-application-foreground-focus/bbfc3d0d-8b20-409d-bfef-035209e1e1d4
  5. https://www.reddit.com/r/Windows10/comments/3vbzth/turn_off_focus_stealing/
  6. https://www.tenforums.com/general-support/122077-turn-off-focus-stealing.html