asweigart / pyautogui

A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.
BSD 3-Clause "New" or "Revised" License
10.22k stars 1.24k forks source link

getWindowsByTitle.activate gives me an error #685

Open pavelcalinmihai opened 2 years ago

pavelcalinmihai commented 2 years ago

Hello. I'm receiving "Error code from Windows: 0 - The operation completed successfully."

opera = pyautogui.getWindowsByTitle("Opera")[0]
opera.activate()

Is important to mention that this issue appears often, but not all the time. After 5+ tries to restart the script, is working but of course.

I'm starting to think that my Windows 11 could be the problem, I didn't encounter any issues on 10.

Does someone else have the same issue?

jl1011 commented 2 years ago

Until this is fixed, I am now using this instead: https://github.com/asweigart/PyGetWindow/issues/16#issuecomment-841448036