def show_window(pid, delay = 0.5):
"""set a windows as principal based on it's process id"""
time.sleep(delay)
for hwnd in get_hwnds(pid):
win32gui.SetForegroundWindow(hwnd)
win32gui.ShowWindow(hwnd, win32con.SW_NORMAL)
文章目录