def enum_callback(hwnd, results):
    winlist.append((hwnd, win32gui.GetWindowText(hwnd)))
win32gui.EnumWindows(enum_callback, toplist)
firefox = [(hwnd, title) for hwnd, title in winlist if 'firefox' in title.
    lower()]
firefox = firefox[0]
win32gui.SetForegroundWindow(firefox[0])
Как убрать фокус или свернуть окно с помощью Python?