[python-win32] hwnd of an application sometimes changes ??

Stef Mientki stef.mientki at gmail.com
Fri Feb 19 23:50:53 CET 2010


hello,

I launch an (Delphi) application with

     subprocess.Popen ( Application, shell=False )

Then with a timer (100 msec), I'm trying to find the applications main 
window,
by looking for the formclass

    self.App_hwnd = win32gui.FindWindow ( self.Application_Form_Class,
                                           self.Application_Caption )

so in the beginning, I'm getting hwnd =0,
then after a while I get a nonzero hwnd,
sometimes it's the correct one,
sometimes not.

In the latter case, looking for the hwnd for a second time, does return 
the correct hwnd.

Any explanation / solution ?

thanks,
Stef Mientki
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20100219/3ef2e05f/attachment.htm>


More information about the python-win32 mailing list