tim roberts eqemprobocom scott nelson wrote im looking use win32api win32gui modules bit windows tinkering win2k activestates python 241 distribution ive hit snag id like processwindow steal focus whatever window currently get bit input keyboard restore focus back original window im seeing unexpected behavior go beyond wrote simple test script enumerates visible windows tries give one focus turn short delay gets 12 windows 810 nonminimized windows open ie notepad wordpad etc gives traceback recent call last file d_codepythonappswintestspy line 25 cycle_foreground file d_codepythonappswintestspy line 20 cycle_foreground win32guisetforegroundwindowhandle pywintypeserror 0 setforegroundwindow error message available wrong case ive attached test script run wintests cycle attempt cycle focus top level windows see traceback test runs completion without error xp machine always window causes explode didnt say window possible applications want become foreground unless idea setforegroundwindow sends wm_activate message application veto suggestion also application call locksetforegroundwindow prevent another application stealing focus away may simply need trap error tim roberts eqemprobocom providenza boekelheide inc _______________________________________________ pythonwin32 mailing list kpitckaew45pythonorg httpmailpythonorgmailmanlistinfopythonwin32 wed 06 aug 2008 050432 0700 pythonwin32 confusion setforegroundwindow