def hwd_get_pos(list,tuple): for x in list: if isinstance(x,(int)): print 'hwd:', x,' pos: ', win32gui.GetWindowRect(x) if win32gui.GetWindowRect(x) ==tuple: return x return 0