def handle_window(hwnd,extra):#TB_handle?? if win32gui.IsWindowVisible(hwnd): if extra in win32gui.GetWindowText(hwnd): global handle handle= hwnd