[python-win32] Re: Help needed : FindWindowEx

Roger Upole rwupole at msn.com
Thu May 3 06:25:37 CEST 2007


> Amit Arora wrote:
> Hi, 
> 
> I am a Amateur in python and an doing some work on Python and Win32 APIs.
> 
> One of my task includes finding the active window , during any
> installation proces and proceed ......
> Take an instance : I connect a USB device say a USB printer to the USB
> port , as soon as it connects we get a pop-up saying "New Hardware Found" 
> 
> I need to detect that popup , and then proceed with the other
> installation steps if that popup occurs :
> 
> Trying to check its appearance with the following command : 
> 
> #!/usr/local/bin/python
> Import os , win32gui, win32ui 
> 
> hWnd = win32ui.FindWindowEx(win32gui.GetDesktopWindow(), None,
> "wndclass_desked_gsk",None)
> 
> Getting the following message : 
> Traceback (most recent call last):
>   File "<interactive input>", line 1, in <module>
> win32ui: No window can be found.

A couple things to check:
Are you sure the window class name is correct ?
Is the desktop window actually its parent ?

   hth
       Roger



More information about the Python-win32 mailing list