Re: findwindow by its class name

Discussion in 'Python' started by Steve Holden, Oct 21, 2005.

  1. Steve Holden

    Steve Holden Guest

    James Hu wrote:
    > Hi,
    >
    > For the simple code:
    >
    > from wxPython.wx import *
    >
    > class MyApp(wxApp):
    > def OnInit(self):
    > frame = wxFrame(NULL, -1, "Hello App")
    > frame.Show(true)
    > self.SetTopWindow(frame)
    > return true
    >
    > app = MyApp(0)
    > app.MainLoop()
    >
    > Is there any way to know this windows' class name? I need to find it by
    > win32gui.FindWindow(classname,None) and send msg from another
    > application, but not using its title "Hello App".
    > MyApp is not the classname, for it couldn't be found by
    > FindWindow("MyApp",None).
    >
    > Thanks a lot in advance!
    >

    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.

    regards
    Steve
    --
    Steve Holden +44 150 684 7255 +1 800 494 3119
    Holden Web LLC www.holdenweb.com
    PyCon TX 2006 www.python.org/pycon/
     
    Steve Holden, Oct 21, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Hu

    findwindow by its class name

    James Hu, Oct 21, 2005, in forum: Python
    Replies:
    0
    Views:
    488
    James Hu
    Oct 21, 2005
  2. Paul Moore
    Replies:
    0
    Views:
    487
    Paul Moore
    Oct 21, 2005
  3. James Hu
    Replies:
    0
    Views:
    767
    James Hu
    Oct 21, 2005
  4. thunk
    Replies:
    1
    Views:
    315
    thunk
    Mar 30, 2010
  5. thunk
    Replies:
    0
    Views:
    488
    thunk
    Apr 1, 2010
Loading...

Share This Page