<div dir="ltr">Hi everybody,<div><br></div><div>There's a problem in my Windows 7 machine that I want to diagnose using Python.</div><div><br></div><div>Once in a while, I'm noticing that focus is being stolen from the active window and then immediately given back. For example, right now as I'm writing this message to you in GMail, I see that the window title, once in about 5 seconds, changes its color rapidly from active to inactive and then to active again. This happens not only in Chrome but in any program. It doesn't always happen, but it's been happening on some days during the last few months. This is really annoying because if I opened a dropdown, for example, this action makes the dropdown disappear. Another example is that if I'm renaming a file in explorer, when the event happens it's as if I pressed "enter" and the file gets the partial name before I finished typing. </div><div><br></div><div>I'm guessing that some app that's installed on my computer is causing this, but I don't know which one. I want to use Python to figure out which one. I want to set Python up to listen to WM_ACTIVATE events (or any other kind of events? Please let me know) and write a log saying which program the focus was passed to. I'm hoping that this way I can find the offending program.</div><div><br></div><div>I have no idea how to write a thing like this in Python, and whether this is even possible. Can you please help me?</div><div><br></div><div><br></div><div>Thanks for your help,</div><div>Ram Rachum.</div></div>