I am sorry if this has been discussed before, but I didn't find a confirmative answer after I searched this topic in the forum.
Long story short, I have a very simply python snippet that used to work in Windows 10.
from pywinauto import application
app = application.Application()
app.start('Notepad.exe')
app.top_window().PrintControlIdentifiers()
After updating to Windows 11, I get the following error when trying to run the same code, "...Python\Python39\lib\site-packages\pywinauto\application.py", line 1156, in top_window raise RuntimeError("No windows for that process could be found") RuntimeError: No windows for that process could be found"
Does this mean pywinauto is not compatible with Windows 11? I have pywinauto 0.6.8 installed with python 3.9.6 64-bit
Thanks.
In my test, it seems the Desktop class of pywinauto library is still working. But this quoted snippet uses the Application class. For some reason it stops working in Windows 11.
.top_window()is not recommended to use. It can catch top window at random moment and freeze it. So real top window will change, but you will still refer to old top window..connect(title="...", timeout=10)should work as well. There is known problem with zero timeout if it is not mentioned. Alsotitle_reshould work. This is more reliable than PID which is different each time.