Changeset 372443a40e16…
Parent 1f3219626658…
by
Changes to one file · Browse files at 372443a40e16 Showing diff from parent 1f3219626658 Diff from another changeset...
@@ -106,7 +106,10 @@
def OnDestroy(self, hwnd, msg, wparam, lparam):
nid = (self.hwnd, 0)
- Shell_NotifyIcon(NIM_DELETE, nid)
+ try:
+ Shell_NotifyIcon(NIM_DELETE, nid)
+ except pywintypes.error:
+ pass # happens when we run without icon
PostQuitMessage(0) # Terminate the app.
def OnTaskbarNotify(self, hwnd, msg, wparam, lparam):
@@ -366,6 +369,7 @@
class PipeServer:
def __init__(self, hwnd):
+ self.hwnd = hwnd
self.updater = Updater(hwnd)
self.updater.start()
@@ -439,6 +443,11 @@
try:
requests.put(data)
+ if data == 'terminate|':
+ print 'PipeServer received terminate from pipe'
+ print 'posting EXIT_CMD to gui thread...'
+ PostMessage(self.hwnd, win32con.WM_COMMAND, EXIT_CMD, 0)
+ break
except SystemExit:
raise SystemExit # interrupted by thread2.terminate()
except:
|
Loading...