How to determine which application is stealing focus

Recently I've had an issue that every 15 minute whatever app I was working on would loose a focus for a few seconds. Obviously some another process window was stealing the focus but the problem was that this another window was not visible and I got the focus back after few seconds. Additionally this also prevented my laptop from going to sleep and even starting the screensaver.

After googling around a bit I find a post from the Matt Gertz It’s Elementary: Using VB To Get Process Information. It describes a way to create an application which prints out information about the current foreground window and the owning process once the application loses focus.

After creating such a small application and leaving it running for a while I found that my mobile telecom Internet USB stick update program was running every 15 minutes (T-Mobile Internet Manager / LiveUpdate / ouc.exe). After that it was easy to find where the application was being started by using the fantastic Sysinternals Autoruns application and turning it off.

I've attached 32 bit and 64 bit versions of the application. First try to run with 32 bit version and if you get an error that 32 bit application can not read 64 bit process information then run the 64 bit application.

Focus stealer 32 bit
Focus stealer 64 bit