mhammond / pywin32

Python for Windows (pywin32) Extensions
5.01k stars 793 forks source link

win32gui_taskbar.py demo system tray throws errors calling win32gui.DestroyWindow #2070

Open ProjectThreepio opened 1 year ago

ProjectThreepio commented 1 year ago

Tested on Python 3.9, 3.10, 3.11 Windows 64-bit.

Start with PyWin32 305, the win32gui_taskbar.py demo does not work cleanly

Specifically, the demo taskbar icon is designed to exit when you double-click it. When the window is destroyed, the following errors are thrown:

WNDPROC return value cannot be converted to LRESULT TypeError: WPARAM is simple, so must be an int object (got NoneType)

The demo works without errors in PyWin32 304 and earlier.

Avasam commented 6 months ago

In fact, doing pretty much anything with the window (typing, clicking on it, clicking off, etc.) produces the following message:

WNDPROC return value cannot be converted to LRESULT
TypeError: WPARAM is simple, so must be an int object (got NoneType)

No traceback. Demo seems to still work outside of that.