4

This question is little different from preventing an application from stealing focus, rather how can I find out what the heck is stealing focus?

It goes like this. I'll be typing something in Firefox on Vista (as I am now). Every few minutes something else is stealing focus. It's not because a window is moving to the foreground. The change is somewhat subtle in window in the foreground takes on the attributes of a de-selected window (e.g., menus slightly dimmed), but it's most notable when typing, as the keys I type are no longer sent to that window. It also makes it extremely annoying.

How can I track this bugger down so I can remove it?

8 Answers 8

3

Try Sysinternals ProcessExplorer. It's a task manager replacement tool which accurately tracks every tiny little process that pops up.

Leave it running and return to your app. When the problem occurs alt-tab to Procexp and you may be able to catch what is grabbing all the attention.

Edit: I have literally just found this: Auslogics TaskManager Which would almost certainly help you identify what's going on, with a more intuitive interface and a wealth of more easily accessible information than Procexp.

0
4

I have the same problem as the poster. I've tried to Alt-Space to bring up the window menu. This definitly shows that there is a "hidden" window present (0x0 in size) that has focus. Using the move menu option to move it around doesn't reveal what it belongs to. Trying to choose the Close menu option does absolutely nothing. Seems like the program ignores the close window event.

I was thinking about a debugger which would be able to add a menu to the window menu of all windows that would allow it to attach to a debugger during runtime. Anyone know of a program that does this?

Update: After it happening again I actually tried the "Minimize" menu option, and loe and behold, it is the AVG Free 9.0 Web Browser window that appears. But why is it hidden and why does it grab focus approx. every 5-10 minutes?

Update2: It seems like AVG has a fix for the problem. http://forums.avg.com/cz-en/avg-free-forum?sec=thread&act=show&id=41015#post_41015

4

I used the excellent Adminscope Focus Logger for this problem. The culprit for me was some Epson utility which did nothing useful and ran as a scheduled task.

Just read the instructions and leave the focus logger running for a while to detect the program which takes the focus away. The program runs on XP (and, presumably, other version of Windows, such as Windows 7, 8, etc.).

EDIT: and, unlike some of the programs listed in this thread, it's freeware.

3

Maybe you can try to alt+tab and see what is the first icon in the list. If it's a laptop, maybe you are touching the touchpad by mistake and you click on the desktop.

1
  • No touchpad, it's a MS Natural keyboard. I tried Alt+Tab before posting, no luck. Aug 25, 2009 at 16:21
2

When the app steals focus try pressing the windows key to the right of the spacebar (context menu). It might show context menu that might help work out what app is stealing the focus.

Failing that try alt-F4 which sends the close message to the window.

2

I used the code at http://archive.msdn.microsoft.com/templeofvb/Release/ProjectReleases.aspx?ReleaseId=18 just now to find it.

For me, it was Google talk, lab edition.

1
  • That's some awesome Win32 magic. Jan 22, 2012 at 20:38
1

I had this problem as well, so annoying. I used that Auslogics TaskManager, and found a process on there (forget what it was called) that was some video player for AIM ads. Google unknown processes .exe's until you find it, then uninstall it via the Control Panel.

There was one more thing I saw, and it was this Java automatic running thing, you have to go into: Start button, Control Panel, Java, Advanced Tab, Miscellaneous, and UNCHECK "Java Quick Starter"

I did those two things, and problem so far seems to be completely solved :). Also, make sure you close AIM and any web browsers before you uninstall.

0

I just had a problem where something continuously kept stealing focus, preventing me from typing in VS Code. This is on Windows 11 22H2; I recognise that this is a very old question, but I think that further answers might still be helpful.

When I pressed Alt + Space to open the window handle menu, I got a menu that appeared to be attached to no window at all. I chose Move and got a ‘window’ that was totally transparent, without any content, title text or decorations whatsoever; I just got a mouse cursor that indicated that I'm indeed moving a window. An attempt to close it from the handle menu wasn't successful; the ghost window stayed active and kept stealing focus.

I finally started to close all other applications one by one and tried to keep typing in VS Code. Finally, when I had closed a WSL (Debian) prompt in Windows Terminal the problem got solved.

Why the WSL prompt kept stealing the focus remains a mystery; after relaunching it, the problem no longer reappeared. I don't know if Sysinternal's Process Explorer would have revealed this, because WSL is no ordinary process, but in any case, I'm not an admin (except inside the Linux distro run by WSL), didn't want to spend my time figuring out whether I can install and run it without admin rights, and even if I could, would it have shown enough information to solve the problem.

So this is what I would recommend to anyone running into this problem: try to activate the focus-stealing UI with Alt + Space or with a context menu key. Then, start closing other visible apps one by one and keep using the app that you want to stay active; test after each closing if the problem persists. If you have closed all other visible apps and the problem is still there, then keep closing apps shown on systray. At some point you'll probably find your culprit.

2
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Jun 7, 2023 at 11:21
  • @Destroy666 thanks for your helpful edits! I had forgotten that Stack Exchange has these <kbd> tags.
    – pinjaliina
    Jun 7, 2023 at 13:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .