Hi,

I wrote code blow for trying uninstall program form the control panel.
Somehow the code doesn't work.

 def CollectChildWindows(hwnd,  childWindows):
    print win32gui.GetWindowText(hwnd)
    #childWindows.append((hwnd, win32gui.GetWindowText(hwnd),
win32gui.getClassName(hwnd)))

if __name__ == '__main__':
    import os
    import win32com.client
    import win32api
    import win32gui
    os.system('control.exe appwiz.cpl')

    Currenthwnd = win32gui.FindWindow('NativeHWNDHost','Add or Remove
Programs')
    childWindows = []
    if Currenthwnd:
      windows =
win32gui.EnumChildWindows(Currenthwnd,CollectChildWindows,childWindows)
    else:
      print 'NG'

It seems I can not get the child windows.


Thanks
Vince
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to