How to send simulated keyboard strokes to the active window using SendKeys

前端 未结 2 816
误落风尘
误落风尘 2021-01-06 12:49

I am new to Python and am trying to send a combination of key strokes to an application I open under Windows 7. While my script will work flawlessly when I invoke Notepad.ex

2条回答
  •  情话喂你
    2021-01-06 12:59

    I know this was asked 6 years ago, but someone might be with the same problem, so here is a possible solution:

    shell.AppActivate('Put_The_Name_Here')

    The code above will select the program, file, etc that is opened but not activated, that, maybe, is your problem.

    Hope this helps someone!

提交回复
热议问题