Infinidat / infi.systray

Windows system tray icon
BSD 3-Clause "New" or "Revised" License
216 stars 40 forks source link

Broken on Windows 10? #9

Open pannal opened 6 years ago

pannal commented 6 years ago

I'm getting this error when simply running the following code:

    with SysTrayIcon("1.ico", "Example tray icon") as tray:
        do_something()
Exception in thread Thread-1:
Traceback (most recent call last):
  File "c:\python27\lib\threading.py", line 810, in __bootstrap_inner
    self.run()
  File "c:\python27\lib\threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "c:\python27\lib\site-packages\infi\systray\traybar.py", line 111, in _message_loop_func
    PumpMessages()
  File "c:\python27\lib\site-packages\infi\systray\win32_adapter.py", line 188, in PumpMessages
    TranslateMessage(ctypes.byref(msg))
ArgumentError: argument 1: <type 'exceptions.TypeError'>: expected LP_MSG instance instead of pointer to MSG
pannal commented 6 years ago

Using ctypes.wintypes.MSG and ctypes.wintypes.POINT instead of your MSG() and POINT() classes, works.

wiggin15 commented 6 years ago

I could not reproduce the same issue on Windows 10, but I committed a change to use the ctypes.wintypes types. Can you please pull the latest code from the develop branch and see if the issue is resolved?