commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1055366 - in /commons/proper/daemon/trunk: RELEASE-NOTES.txt src/native/windows/apps/prunmgr/prunmgr.c
Date Wed, 05 Jan 2011 09:17:32 GMT
Author: mturk
Date: Wed Jan  5 09:17:32 2011
New Revision: 1055366

URL: http://svn.apache.org/viewvc?rev=1055366&view=rev
Log:
DAEMON-187 Pop up already running manager instead displaying error message box

Modified:
    commons/proper/daemon/trunk/RELEASE-NOTES.txt
    commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.c

Modified: commons/proper/daemon/trunk/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/RELEASE-NOTES.txt?rev=1055366&r1=1055365&r2=1055366&view=diff
==============================================================================
--- commons/proper/daemon/trunk/RELEASE-NOTES.txt (original)
+++ commons/proper/daemon/trunk/RELEASE-NOTES.txt Wed Jan  5 09:17:32 2011
@@ -70,7 +70,7 @@ NEW FEATURES:
 
 BUG FIXES:
 
-1.0.5: DAEMON-158, DAEMON-188, DAEMON-190
+1.0.5: DAEMON-158, DAEMON-187, DAEMON-188, DAEMON-190
 
 1.0.4: DAEMON-95, DAEMON-171, DAEMON-100, DAEMON-164, DAEMON-165, DAEMON-175,
        DAEMON-177, DAEMON-150, DAEMON-163, DAEMON-182, DAEMON-181

Modified: commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.c?rev=1055366&r1=1055365&r2=1055366&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.c (original)
+++ commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.c Wed Jan  5 09:17:32
2011
@@ -1514,7 +1514,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, 
 
         break;
         case WM_COMMAND:
-            switch(LOWORD(wParam)) {
+            switch (LOWORD(wParam)) {
                 case IDM_TM_CONFIG:
                     ShowServiceProperties(hWnd);
                 break;
@@ -1564,7 +1564,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, 
             }
         break;
         case WM_TRAYMESSAGE:
-            switch(lParam) {
+            switch (lParam) {
                 case WM_LBUTTONDBLCLK:
                     ShowServiceProperties(hWnd);
                 break;
@@ -1701,11 +1701,18 @@ int WINAPI WinMain(HINSTANCE hInstance,
     if (!_options[0].dwValue) {
         mutex = CreateMutex(NULL, FALSE, _gui_store->szWndMutex);
         if ((mutex == NULL) || (GetLastError() == ERROR_ALREADY_EXISTS)) {
-            /* Skip sytem error message */
-            SetLastError(ERROR_SUCCESS);
-            if (!quiet)
-                apxDisplayError(TRUE, NULL, 0, apxLoadResourceA(IDS_ALREAY_RUNING, 0),
-                                lpCmdline->szApplication);
+            HANDLE hOther = FindWindow(_gui_store->szWndClass, NULL);
+            if (hOther) {
+                SetForegroundWindow(hOther);
+                SendMessage(hOther, WM_COMMAND, MAKEWPARAM(IDM_TM_CONFIG, 0), 0);
+            }
+            else {
+                /* Skip sytem error message */
+                SetLastError(ERROR_SUCCESS);
+                if (!quiet)
+                    apxDisplayError(TRUE, NULL, 0, apxLoadResourceA(IDS_ALREAY_RUNING, 0),
+                                    lpCmdline->szApplication);
+            }
             goto cleanup;
         }
     }



Mime
View raw message