How to detect a background program (in Windows 7) which steals active focus automatically?

24

5

A background process/program steals focus from my currently active application. It disturbs me a lot when I type in an app or control an app using keyboard or play online flash games in full-screen.
I want to remove this program from my PC, but I'm unable to detect it. I've analyzed all processes & scanned for viruses. All things are right from this side.
I don't want to change focus behavior using registry tweak. Please, help me detecting that app..

Apple II

Posted 2011-06-23T16:08:38.527

Reputation: 3 669

Windows Focus Logger was quick-and-easy to identify the culprit in my case, took about 2 minutes to get the name of the offending app (wemgr): http://www.adminscope.com/downloads/window-focus-logger/

– Stabledog – 2016-12-07T14:36:39.693

3Logically, the application that has stolen the input focus is the application that has the input focus after it has been stolen. So state in your question what window on the screen actually receives the input focus when this happens. That will help other people to tell you what is stealing the input focus. – JdeBP – 2011-06-23T16:36:08.473

Are you sure you don't have problems with your keyboard? I had a similar problem with left windows key and left alt key (they remained pressed from time to time. After I replaced the keyboard it was ok. – Nicu Zecheru – 2011-06-23T17:31:03.213

Bit of a generic advice, but try running HiJackThis and study the results/post them in a forum in order to detect the intruder. – vemv – 2011-06-23T18:41:02.830

@JdeBP As a background program is responsible, there's no visible application at all. Only one key-stroke is clearly visible: "Alt+F4". It brings back focus to text box (means, that background program is clearly responding Alt+F4). – Apple II – 2011-06-23T18:45:24.557

@Nicu No,No.. the problem isn't with my keyboard because the same key works after Alt+F4 (See previous my comment). Plus, full-screen online games (like CityVille) comes to normal-mode which happens only when focus is removed. – Apple II – 2011-06-23T18:51:35.147

1This is a known bug in Windows 7 when 3rd party programs are poorly written, start removing items from startup using msconfig, it will be a process of elimination and will take time. – Moab – 2011-06-23T20:40:50.213

2Untrue. Quite a few more keystrokes will be available. Alt+Space will bring up the system menu of the focus-stealing application's window, for example. – JdeBP – 2011-06-24T10:02:52.137

@JdeBP Nice approach, but its not working.. not all processes respond to it! – Apple II – 2011-06-27T21:47:18.850

@Moab You're partially correct.. Focus stealing support was removed from Windows 7, nevertheless it happened. Even manipulation of registry is not working... – Apple II – 2011-06-27T21:49:44.977

2@ Sachin Sheckhar, Yup, its a bug for sure, many complaints out there for this exact issue, its always a 3rd party software or driver causing it, but its not supposed to happen in W7, but it does. – Moab – 2011-06-27T22:47:02.650

Answers

19

The problem has been fixed. At a time of focus stealing, I pressed Alt+F4 and instantly spotted exiting process from Process Explorer.

Note: Windows Process Explorer can be downloaded as part of Windows Sysinternals library.

update: theres's any nice pogramm showing/logging, what process has focus: https://social.technet.microsoft.com/Forums/ie/en-US/dee98b15-0540-4975-b38d-ce3d2ee87c30/figuring-out-whats-stealing-window-focus

may this helps as well http://pcsupport.about.com/od/windowsxp/ht/stealingfocus02.htm

Apple II

Posted 2011-06-23T16:08:38.527

Reputation: 3 669

You should reword your answer, there are two types of focus stealers, one are the ones who start and stop as process, the others are continuous running process which interfere. Process Explorer doesn't tell anything for programs which continuously run, either in tray or background... while focus.exe does the whole trick. If there's a way for PE to tell what current running application do steal focus, then improve your answer, or spit your answer in two sections... – JasonXA – 2015-06-20T21:14:57.053

I have decompiled focus.exe. You can find the source code http://pastebin.com/Pj4PCLE6

– user1421750 – 2016-04-02T22:24:29.217

I'm curious which program keep stealing focus. . . – surfasb – 2011-07-11T19:06:38.690

2Gladinet Cloud Drive. It generally maps online accounts at start-up, but at the time of problem, it failed to log in to Windows Live SkyDrive because of password change. It was re-trying again-n-again with focus stealing! – Apple II – 2011-07-13T22:36:33.180

Interesting . . . – surfasb – 2011-07-14T04:19:41.170

How did you "spotted exiting process from Process Explorer"? I'm fighting the same problem and I was more than sure, that when you press Alt+F4, program is terminated immediately, so you have no chances to open (or even switch to) Task Manager to see, what has just "left" it.

– trejder – 2014-01-30T10:05:15.373

3@trejder Use Process Explorer, not Task Manager shipped with Windows. Process Explorer highlights exiting process with Red. – Apple II – 2014-01-30T10:36:40.647

@SachinShekhar Thanks! Seems, that it does not ships with Windows, but must be downloaded as part of Windows Sysinternals library. Let me re-edit your answer, to include this.

– trejder – 2014-01-30T11:59:16.240

And, @surfasb, as you can see in the (deleted?) other answer, apparently backup software such as "BullGuard backup" might steal focus too. (Weird, but surely good to know what might cause this.) – Arjan – 2014-03-16T11:12:11.800

18

I used http://www.happydroid.com/focus and left the PC running over night to find the program that was stealing the focus.

limex

Posted 2011-06-23T16:08:38.527

Reputation: 321

4Works properly and appears to be virus free. At least for now. Now I just have to wait. :-) – inf3rno – 2017-10-30T00:26:15.550