I get the active window like so:
window = win32gui.GetForegroundWindow()
which is an Int, say 1053634. And afterwards I try to set the fore
This also worked for me
import win32gui, win32com.client shell = win32com.client.Dispatch("WScript.Shell") shell.SendKeys('%') win32gui.SetForegroundWindow(window.hwnd)