hi I have some error code from SetForegroundWindow need some help normally this code work user32 = ctypes.windll.user32 handle = user32.FindWindowW(None, r'*Untitled - Notepad') win32gui.SetForegroundWindow(handle) but its not work when loop continue ps.its work at first time code running before continue loop user32 = ctypes.windll.user32 handle = user32.FindWindowW(None, r'*Untitled - Notepad') while True: win32gui.SetForegroundWindow(handle) a = input(' ') if int(a) == 0: continue else: break I got some erroe like this win32gui.SetForegroundWindow(handle) pywintypes.error: (6, 'SetForegroundWindow', 'The handle is invalid.') please help thank you Continue reading...