0

I am trying to make macro with python

How can I send key event to inactive

Window?

  • You can't. Simple as that. If you want to automate an application, use [UI Automation](https://learn.microsoft.com/en-us/windows/win32/winauto/entry-uiauto-win32). – IInspectable Jul 13 '20 at 16:57
  • Actually win32api.SendMessage worked – user13819736 Jul 16 '20 at 09:57
  • This is another case of ignoring the difference between *"correct code"* and *"code, that has not yet failed"*. Your code is in the latter category. [Here's why](https://devblogs.microsoft.com/oldnewthing/20050530-11/?p=35513). – IInspectable Jul 16 '20 at 10:34

0 Answers0