win32gui.SetActiveWindow() ERROR : The specified procedure could not be found

前端 未结 2 1113
星月不相逢
星月不相逢 2020-12-03 22:31

I get the active window like so:

window = win32gui.GetForegroundWindow()

which is an Int, say 1053634. And afterwards I try to set the fore

2条回答
  •  感动是毒
    2020-12-03 22:53

    This also worked for me

    import win32gui, win32com.client
    shell = win32com.client.Dispatch("WScript.Shell")
    shell.SendKeys('%')
    win32gui.SetForegroundWindow(window.hwnd)
    

提交回复
热议问题