Changeset ff0cede782a4…
Parent 449db6a44726…
by
Changes to 4 files · Browse files at ff0cede782a4 Showing diff from parent 449db6a44726 Diff from another changeset...
@@ -104,7 +104,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):
@@ -339,6 +342,7 @@
class PipeServer:
def __init__(self, hwnd):
+ self.hwnd = hwnd
self.updater = Updater(hwnd)
self.updater.start()
@@ -412,6 +416,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:
|
@@ -21,6 +21,15 @@ Thgstatus.obj \
QueryDirstate.obj
+# TODO: Break link dependencies: Thgstatus needs ThgDebug if compiled with
+# /DTHG_DEBUG, which in turn depends on TortoiseUtils and then even
+# IconBitmapUtils and SysInfo
+OBJECTS_TERMINATE = TortoiseUtils.obj \
+ SysInfo.obj \
+ IconBitmapUtils.obj \
+ Thgstatus.obj \
+ ThgDebug.obj
+
LIBS = shlwapi.lib gdiplus.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
DEFFILE = ShellExt.def
@@ -30,9 +39,10 @@BASE_LDFLAGS = /nologo /INCREMENTAL:NO /MANIFEST $(LIBS)
LDFLAGS_THGSHELL = $(BASE_LDFLAGS) /DLL /DEF:$(DEFFILE)
LDFLAGS_DIRSTATE = $(BASE_LDFLAGS) /SUBSYSTEM:CONSOLE
+LDFLAGS_TERMINATE = $(BASE_LDFLAGS) /SUBSYSTEM:CONSOLE
-all: THgShell.dll
+all: THgShell.dll terminate.exe
clean:
del *.obj *.dll *.exe *.lib *.exp *.manifest
@@ -44,3 +54,7 @@dirstate.exe: dirstate.obj $(OBJECTS_DIRSTATE)
link /OUT:$@ $(LDFLAGS_DIRSTATE) $**
mt -nologo -manifest $@.manifest -outputresource:"$@;#1"
+
+terminate.exe: terminate.obj $(OBJECTS_TERMINATE)
+ link /OUT:$@ $(LDFLAGS_TERMINATE) $**
+ mt -nologo -manifest $@.manifest -outputresource:"$@;#1"
|
@@ -33,6 +33,9 @@ static int error(const std::string& text) {
return SendRequest("error|" + text);
}
+ static int terminate() {
+ return SendRequest("terminate|");
+ }
};
#endif
|
|
@@ -0,0 +1,11 @@ + // terminates the overlay icon server
+
+#include "stdafx.h"
+
+#include "Thgstatus.h"
+
+int main(int argc, char *argv[])
+{
+ Thgstatus::terminate();
+ return 0;
+}
|
Loading...