Applications Stealing Focus on Windows XP

November 16th, 2004 by jr in Technology, Tools, Windows

One of the most annoying “features” of Windows (9x/2000/XP) is the fact, that any application can steal the focus of the front-most application: I repeatedly sent Ölbaum snippets of code or some command-line when he was contacting me via AIM or MSN on Windows because that apps would steal the focus of whatever window I was working in. It’s a wonder I never sent him a password of mine or so …

Of course, this same behaviour started to bug me at my new workplace. Thus, I was not only bugged by these intrusive Windows Notifications in the taskbar, I also got the benefit of windows randomly yelling at me during work.

Focus

Fortunately, I found a vaccine against this: Power Toys for Windows XP, a free download for TweakUI from Microsoft. TweakUI lets you tweak some settings of the Windows UI, including one to “Prevent applications from stealing focus”:

Check “Prevent applications from stealing focus” to prevent applications from stealing focus from the window you are working in. Instead, their taskbar icon will flash to indicate that the application is trying to get your attention. (Emphasis by editor)

Let em try, I say!


Can anybody tell me why

  • Microsoft Power Toys for Windows XP are not part of a standard install?
  • Microsoft does not include this setting per default in a Windows XP install?

Sheeesh …

11 Responses to “Applications Stealing Focus on Windows XP”

  1. Dallas Says:

    I have tried this, but IE 7 still allows certian Windows to pop up & steal away the focus - looks like it’s back to Maxthon for me

  2. Eric Thompson Says:

    I must concur with Dallas: TweakUI may help, but it appears that nothing will stop IE 7 from controlling my desktop.

  3. multineedia » Blog Archive » Applications Stealing Focus on Windows XP Says:

    [...] Most useful Windows XP Tip ever. taking the red pill - » Applications Stealing Focus on Windows XP [...]

  4. Mark Says:

    While TweakUIXP may work at the moment. I find that I am losing the setting and have to reset several times a week. Something else is ‘unfixing’ the setting.

    What and Why?

    Solution?

  5. Eric Says:

    I’ve noticed that something is undoing the setting as well. You can run this reg file every day or so and it will reset it to the TweakUI value:

    Windows Registry Editor Version 5.00

    [HKEYCURRENTUSER\Control Panel\Desktop] “ForegroundLockTimeout”=dword:00030d40

    I put it in the task scheduler and run it every 4 hours.

  6. Eric Says:

    ^^ It ate the formatting. There should be underscores between HKEY CURRENT and USER.

    You could also put this in a bat file and run it every few hours:

    reg ADD “HKEYCURRENTUSER\Control\Panel\Desktop” /v ForegroundLockTimeout /t REG_DWORD /d 0×00030d40 /f > nul

    Place underscores between HKEY CURRENT and USER.

  7. Eric Says:

    Arrgh. Replace backslash between control and panel with a space.

  8. Jerry T. Says:

    There must be some other registry key that works in conjunction with this one. On my PC I was able to duplicate a user’s issue with a pop-up (from a JavaScript alert window) but my Prevent apps from stealing focus was OFF. I turned it on and the pop-up did NOT steal focus from the foreground app.

    But, on the user’s PC, the pop-up still steals focus. Even had our help desk rebuild the user’s PC (reinstalled Windows XP) and verified the TweakUI checkbox was on and the issue still exists for them but I can’t dupe it with that registry setting on.

    Bizarre.

  9. Phil Says:

    Thank you JR.

    Before the fix, after starting Windows XP I wanted to get a command prompt and run a few commands. Icons appearing in the System Tray caused the focus to be lost from the Run dialog and the Cmd window about four times, argh!

    After the fix, I was able to type away with the keyboard consistently in the Run dialog and the Cmd window without any interruptions. Much, much better.

    Why Microsoft does not include this setting as default in Windows XP? I have no idea. I would go to the trouble of writing a paid-for postal letter to Microsoft, but after the Vista debacle - depressingly - I have no faith in Microsoft’s ability to respond to consumer feedback.

  10. John Sinclair Says:

    Well I’ve got vista now, and there seems to be a huge problem with windows grabbing the focus - its like XP, but back before this I used this setting. And no tweak XP for vista. So I looked up the reg key that it sets, and it IS ALREADY SET! WTF? does this setting no longer work in vista!?

  11. Advokat Says:

    Hi there,

    This is some pretty cool thing you got going here. Gonna check out the remaining site pages to see if there are any updates. ;)

    Cheers! :)

Leave a Reply