[python-win32] findwindow by its class name

James Hu jhu at metrigenix.com
Fri Oct 21 15:26:52 EDT 2005


Thanks a lot! Yes, GetHandle() can return 'wxWindowClassNR', which is
nice,
but all wxPython apps return wxWindowClassNR as well, so when I Post
Message, it goes to itself. 

James

-----Original Message-----
From: python-win32-bounces+jhu=metrigenix.com at python.org
[mailto:python-win32-bounces+jhu=metrigenix.com at python.org] On Behalf Of
Paul Moore
Sent: Friday, October 21, 2005 2:28 PM
To: Steve Holden
Cc: python-list at python.org; python-win32 at python.org
Subject: Re: [python-win32] findwindow by its class name

On 10/21/05, Steve Holden <steve at holdenweb.com> wrote:
> > Is there any way to know this windows' class name? I need to find it
by
[...]
> I'm not saying it can'ty be done (which is a pity for you, because
> that's usually a cue for someone to contradict me) but it's expecting
> quite a lot of win32gui. A wxPython application is not a windows
handle,
> and I suspect you will find that the classname you seek isn't visible
> from inside (wx)Python.

You had to make me do it, didn't you? :-)

wxPython windows expose their HWND via the GetHandle() method. So you
can get the frame's class name as

    win32gui.GetClassName(frame.GetHandle())

FWIW, I get a constant value of "wxWindowClassNR".

Hope this helps,
Paul.
_______________________________________________
Python-win32 mailing list
Python-win32 at python.org
http://mail.python.org/mailman/listinfo/python-win32



More information about the Python-list mailing list