up vote 18 down vote favorite
13
share [g+] share [fb]

Are there any solutions to prevent applications stealing focus from the active window? This is especially annoying when I'm starting an application, switch to do something else and the new application starts receiving half a sentence of text.

link|improve this question

Vista or XP? Since Vista has some known issues with workarounds – Ivo Flipse Aug 5 '09 at 9:14
2  
@Ivo Windows 7 in my case but I think for SuperUser all windows versions would be relevant – Pacifika Aug 5 '09 at 9:48
XP has a known solution, and a question superuser.com/questions/138648/… so maybe this question should be for Windows 7 only? – endolith Feb 20 '11 at 1:02
The moderator merged this question: superuser.com/questions/199821/… with the current one. This is wrong, the answer to the current question does not apply to windows 7, so it shouldnt be merged. So far I could not find a solution to this problem in Windows 7 – Alejandro Angelico Oct 13 '11 at 13:38
feedback

3 Answers

up vote 4 down vote accepted

There is an option in TweakUI which does this. It prevents most of the usual tricks dubious software developers employ to force focus on their app.

It's an ongoing arms war though, so I don't know if it works for everything.

Update: According to EndangeredMassa, TweakUI does not work on Windows 7.

link|improve this answer
1  
is tweakui compatible with windows 7? – frankster Jan 13 '10 at 9:18
@frankster. No idea, sorry, I suspect it probably isn't. Download it and try it. Report back if you do so everyone knows. – Simon P Stevens Jan 13 '10 at 15:51
1  
Even using the registry setting that TweakUI sets doesn't work on Win7. – EndangeredMassa Oct 15 '10 at 19:19
feedback

Ghacks has a possible solution:

It happens several times a day that some applications steal the focus of the active window by popping up. This can happen for a number of reasons, when I extract files or a transfer finishes for instance. It does not matter most of the time when this happens but sometimes I’m writing an article and it does not only mean that I have to type some words again but also that I lost concentration and have to click to regain focus.

The Pro Reviewer website has a tip on how to prevent this from happening. 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.

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.

link|improve this answer
5  
This doesn't work on any OS after XP. That registry value is already set to that (by default, I believe) and doesn't work anyway. – EndangeredMassa Oct 15 '10 at 19:18
feedback

The standard way to disable applications stealing focus is to :

  1. Use regedit to go to: HKEY_CURRENT_USER\Control Panel\Desktop.
  2. Double-click on ForegroundLockTimeout and set its value in hexadecimal to 30d40.
  3. Press OK and exit regedit.
  4. Reboot your PC for the changes to take effect.

From this point forward, programs should (in theory) no longer steal the focus from the window that you're currently working in. Although this is the documented solution, it may not always work for everybody.

Another possibility is the MS-Windows focus-follows-mouse Registry hacks, where the focus and/or activation goes always to the windows under the cursor.

link|improve this answer
2  
That is the default setting in W7, and no it still does not work, it is a BUG in Windows, that MS refuses to fix. Focus stealing Drives me nuts too. Some applications steal focus some do not, it is a BUG. – Moab Dec 15 '10 at 16:08
1  
@Moab: It does work, just not for some badly-written applications. That's the registry edit that TweakUI does in XP. – harrymc Dec 15 '10 at 16:40
1  
If it is to "prevent" apps from stealing focus, it does a poor job. – Moab Dec 15 '10 at 17:13
5  
@Moab: Yes, as always a Microsoft solution is half-baked. – harrymc Dec 15 '10 at 19:06
1  
@harrymc: I still have applications stealing focus. Since this doesn't solve the problem for specific programs or all programs I cannot accept this answer. – Jonathan Hobbs Dec 20 '10 at 8:59
show 8 more comments
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.