Closed TomsonBoylett closed 3 years ago
Thank you for your report, and apologies for the late reply.
I think your suggestion to instantiate a new windll
is what this library has needed for a very long time! I have made a new release and pushed it to Github; unfortunately it appears that my upload script is no longer compatible with PyPi: I get the following message:
Upload failed (400): Invalid value for blake2_256_digest. Error: Use a valid, hex-encoded, BLAKE2 message digest.
I will look into this in the following days, but in the meantime, you may use Github as a mirror.
I switched to the new version and I can confirm it fixed the issue. Thanks for the update!
The code above causes the following error
Based on the contents of a similar pywinauto issue here, I think the issue is that pystray is setting attributes on the global windll instance.
I have confirmed this by removing the following lines from pystray_util\win32.py
This prevents the error but stops pystray detecting mouse events properly.
I'm guessing the fix is either to create a new instance using
windll = ctypes.LibraryLoader(ctypes.WinDLL).
or to call the global instance without setting any attributes.See related issue for pyautogui here