You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by mt...@apache.org on 2004/04/08 09:41:33 UTC
cvs commit: jakarta-commons/daemon/src/native/nt/procrun/apps/prunsrv prunsrv.c
mturk 2004/04/08 00:41:33
Modified: daemon/src/native/nt/procrun/apps/prunsrv prunsrv.c
Log:
When deleting service close the monitor application if present.
This is used for uninstall if the user didn't close the monitor application.
Revision Changes Path
1.2 +10 -1 jakarta-commons/daemon/src/native/nt/procrun/apps/prunsrv/prunsrv.c
Index: prunsrv.c
===================================================================
RCS file: /home/cvs/jakarta-commons/daemon/src/native/nt/procrun/apps/prunsrv/prunsrv.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- prunsrv.c 7 Apr 2004 11:21:43 -0000 1.1
+++ prunsrv.c 8 Apr 2004 07:41:33 -0000 1.2
@@ -529,8 +529,17 @@
return FALSE;
}
/* Delete service will stop the service if running */
- if (apxServiceOpen(hService, lpCmdline->szApplication))
+ if (apxServiceOpen(hService, lpCmdline->szApplication)) {
+ WCHAR szWndManagerClass[SIZ_RESLEN];
+ HANDLE hWndManager = NULL;
+ lstrcpyW(szWndManagerClass, lpCmdline->szApplication);
+ lstrcatW(szWndManagerClass, L"_CLASS");
+ /* Close the monitor application if running */
+ if ((hWndManager = FindWindowW(szWndManagerClass, NULL)) != NULL) {
+ SendMessage(hWndManager, WM_CLOSE, 0, 0);
+ }
rv = apxServiceDelete(hService);
+ }
if (rv) {
/* Delete all service registry settings */
apxDeleteRegistryW(PRG_REGROOT, lpCmdline->szApplication, TRUE);
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org