[python-win32] Figuring out why a window is losing focus
Zachary Turner
zturner at google.com
Sun Feb 7 16:55:37 EST 2016
You can log the messages going to a particular window. Just click Spy ->
Log Messages. But it occurred to me you want to know *which* process is
sending the message. I don't believe there's a way to do that short of
hooking the native PostMessage and SendMessage Win32 APIs in every process
running on the system.
On Sun, Feb 7, 2016 at 1:19 PM Ram Rachum <ram at rachum.com> wrote:
> Thanks for the reference to Spy++! I'm checking it out and it looks like a
> useful program. But I don't understand, how do I use it to accomplish what
> I wanted?
>
> On Sun, Feb 7, 2016 at 10:39 PM, Zachary Turner <zturner at google.com>
> wrote:
>
>> Why do you need to use Python? Sounds like this is done very easily with
>> Spy++
>>
>> On Sun, Feb 7, 2016 at 10:12 AM Ram Rachum <ram at rachum.com> wrote:
>>
>>> Hi everybody,
>>>
>>> There's a problem in my Windows 7 machine that I want to diagnose using
>>> Python.
>>>
>>> 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.
>>>
>>> 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.
>>>
>>> I have no idea how to write a thing like this in Python, and whether
>>> this is even possible. Can you please help me?
>>>
>>>
>>> Thanks for your help,
>>> Ram Rachum.
>>> _______________________________________________
>>> python-win32 mailing list
>>> python-win32 at python.org
>>> https://mail.python.org/mailman/listinfo/python-win32
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20160207/eb0779af/attachment.html>
More information about the python-win32
mailing list