Fix tray icon destroy overflow exception
This commit is contained in:
parent
a5971adbe6
commit
ca94703fc3
1 changed files with 2 additions and 1 deletions
|
@ -566,10 +566,11 @@ class NotificationIcon(object):
|
||||||
# print "NotificationIcon error", err, message
|
# print "NotificationIcon error", err, message
|
||||||
message = MSG()
|
message = MSG()
|
||||||
time.sleep(0.125)
|
time.sleep(0.125)
|
||||||
print("Icon thread stopped, removing icon...")
|
print("Icon thread stopped, removing icon (hicon: %s, hwnd: %s)..." % (self._hicon, self._hwnd))
|
||||||
|
|
||||||
Shell_NotifyIcon(NIM_DELETE, ctypes.cast(ctypes.pointer(iconinfo), ctypes.POINTER(NOTIFYICONDATA)))
|
Shell_NotifyIcon(NIM_DELETE, ctypes.cast(ctypes.pointer(iconinfo), ctypes.POINTER(NOTIFYICONDATA)))
|
||||||
ctypes.windll.user32.DestroyWindow(self._hwnd)
|
ctypes.windll.user32.DestroyWindow(self._hwnd)
|
||||||
|
ctypes.windll.user32.DestroyIcon.argtypes = [ctypes.wintypes.HICON]
|
||||||
ctypes.windll.user32.DestroyIcon(self._hicon)
|
ctypes.windll.user32.DestroyIcon(self._hicon)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue