def window_foreground_loop(timeout=20):
""" set the windows python console to the foreground (for example when you are working with a fullscreen program) """
hwnd=int(win32console.GetConsoleWindow())
while True:
win32gui.SetWindowPos(hwnd, win32con.HWND_TOPMOST, 0,0,0,0, win32con.SWP_NOMOVE | win32con.SWP_NOSIZE)
time.sleep(timeout)
评论列表
文章目录