[python-win32] findwindow by its class name

Mark Hammond mhammond at skippinet.com.au
Sat Oct 22 06:50:20 CEST 2005


Re: [python-win32] findwindow by its class nameIf all else fails, you could
create a win32gui based hidden window with a classname of your choice.
pywin32's win32gui_taskbar.py does exactly this.  You would probably need to
create this window in its own thread running a win32gui message pump, so you
would need to arrange a way to communicate with your main wx thread - but it
should be able to be made to work.

As for changing the wx classname, you would be better off asking a wx list.

Cheers,

Mark

 -----Original Message-----
From: python-win32-bounces at python.org
[mailto:python-win32-bounces at python.org]On Behalf Of James Hu
Sent: Saturday, 22 October 2005 1:59 PM
To: Gabriel Genellina
Cc: python-win32 at python.org
Subject: Re: [python-win32] findwindow by its class name


  Thanks,
  Actually, app A is a commercial engine, which written by VC++, but we
can't change it at all.
  app B is our application, which written by wxPython, If we can't find a
way to get the classname of app B, it's no way for app A to send the message
to app B , for app A uses classname to get the handler of app B, not it's
windows caption. RegisterWindowMessage can't do this job either.

  Can we register/bind a specific classname for any wxPython application?

  James



----------------------------------------------------------------------------
--
  From: Gabriel Genellina [mailto:gagenellina at softlab.com.ar]
  Sent: Fri 10/21/2005 8:18 PM
  To: James Hu
  Cc: python-win32 at python.org
  Subject: Re: [python-win32] findwindow by its class name


  At Friday 21/10/2005 16:26, you wrote:

  >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.

  Application A can broadcast a private known message (using
  RegisterWindowMessage) including its own HWND; Application B handles it
and
  replies to A with its own HWND.  After that, both apps know the other's
  HWND and can post messages.



  Gabriel Genellina
  Softlab SRL


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20051022/d613ead5/attachment.html


More information about the Python-win32 mailing list