Author: gschneider
Date: Tue Dec 29 18:55:44 2009
New Revision: 44801
URL:
http://svn.reactos.org/svn/reactos?rev=44801&view=rev
Log:
[taskmgr]
- Allow task manager to activate and restore a previous instance when the mutex already
exists
- Make application title identical to the window title for languages where it wasn't
Modified:
trunk/reactos/base/applications/taskmgr/lang/en-US.rc
trunk/reactos/base/applications/taskmgr/lang/fr-FR.rc
trunk/reactos/base/applications/taskmgr/lang/ja-JP.rc
trunk/reactos/base/applications/taskmgr/lang/ko-KR.rc
trunk/reactos/base/applications/taskmgr/lang/nl-NL.rc
trunk/reactos/base/applications/taskmgr/lang/ro-RO.rc
trunk/reactos/base/applications/taskmgr/lang/sk-SK.rc
trunk/reactos/base/applications/taskmgr/lang/uk-UA.rc
trunk/reactos/base/applications/taskmgr/lang/zh-CN.rc
trunk/reactos/base/applications/taskmgr/taskmgr.c
Modified: trunk/reactos/base/applications/taskmgr/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/lang/en-US.rc [iso-8859-1] Tue Dec 29 18:55:44
2009
@@ -165,7 +165,7 @@
STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP |
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU |
WS_THICKFRAME
-CAPTION "ReactOS Task Manager"
+CAPTION "Task Manager"
MENU IDR_TASKMANAGER
FONT 8, "MS Shell Dlg"
BEGIN
Modified: trunk/reactos/base/applications/taskmgr/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/lang/fr-FR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/lang/fr-FR.rc [iso-8859-1] Tue Dec 29 18:55:44
2009
@@ -165,7 +165,7 @@
STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP |
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU |
WS_THICKFRAME
-CAPTION "Gestionnaire des tâches ReactOS"
+CAPTION "Gestionnaire des tâches"
MENU IDR_TASKMANAGER
FONT 8, "MS Shell Dlg"
BEGIN
Modified: trunk/reactos/base/applications/taskmgr/lang/ja-JP.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/lang/ja-JP.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/lang/ja-JP.rc [iso-8859-1] Tue Dec 29 18:55:44
2009
@@ -165,7 +165,7 @@
STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP |
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU |
WS_THICKFRAME
-CAPTION "ReactOS ^XN }l[W"
+CAPTION "^XN }l[W"
MENU IDR_TASKMANAGER
FONT 9, "MS UI Gothic"
BEGIN
Modified: trunk/reactos/base/applications/taskmgr/lang/ko-KR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/lang/ko-KR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/lang/ko-KR.rc [iso-8859-1] Tue Dec 29 18:55:44
2009
@@ -168,7 +168,7 @@
STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP |
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU |
WS_THICKFRAME
-CAPTION "ReactOS ÀÛ¾÷ °ü¸®ÀÚ"
+CAPTION "ÀÛ¾÷ °ü¸®ÀÚ"
MENU IDR_TASKMANAGER
FONT 8, "MS Shell Dlg"
BEGIN
@@ -523,7 +523,7 @@
STRINGTABLE DISCARDABLE
BEGIN
- IDS_APP_TITLE "ÀÛ¾÷ °ü¸®ÀÚ"
+ IDS_APP_TITLE "ÀÛ¾÷ °ü¸®ÀÚ"
IDC_TASKMGR "ÀÛ¾÷ °ü¸®ÀÚ"
IDS_IDLE_PROCESS "System Idle Process"
END
Modified: trunk/reactos/base/applications/taskmgr/lang/nl-NL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/lang/nl-NL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/lang/nl-NL.rc [iso-8859-1] Tue Dec 29 18:55:44
2009
@@ -165,7 +165,7 @@
STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP |
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU |
WS_THICKFRAME
-CAPTION "Reactos Taakbeheer"
+CAPTION "Taakbeheer"
MENU IDR_TASKMANAGER
FONT 8, "MS Shell Dlg"
BEGIN
@@ -523,7 +523,7 @@
STRINGTABLE DISCARDABLE
BEGIN
- IDS_APP_TITLE "Reactos Taakbeheer"
+ IDS_APP_TITLE "Taakbeheer"
IDC_TASKMGR "Taakbeheer"
IDS_IDLE_PROCESS "Niet-actieve systeemprocessen"
END
Modified: trunk/reactos/base/applications/taskmgr/lang/ro-RO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/lang/ro-RO.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/lang/ro-RO.rc [iso-8859-1] Tue Dec 29 18:55:44
2009
@@ -165,7 +165,7 @@
STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP |
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU |
WS_THICKFRAME
-CAPTION "Gestionarul de activitÄÈi ReactOS"
+CAPTION "Gestionarul de activitÄÈi"
MENU IDR_TASKMANAGER
FONT 8, "MS Shell Dlg"
BEGIN
Modified: trunk/reactos/base/applications/taskmgr/lang/sk-SK.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/lang/sk-SK.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/lang/sk-SK.rc [iso-8859-1] Tue Dec 29 18:55:44
2009
@@ -164,7 +164,7 @@
STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP |
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU |
WS_THICKFRAME
-CAPTION "Správca úloh systému ReactOS"
+CAPTION "Správca úloh systému"
MENU IDR_TASKMANAGER
FONT 8, "MS Shell Dlg"
BEGIN
Modified: trunk/reactos/base/applications/taskmgr/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/lang/uk-UA.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/lang/uk-UA.rc [iso-8859-1] Tue Dec 29 18:55:44
2009
@@ -165,7 +165,7 @@
STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP |
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU |
WS_THICKFRAME
-CAPTION "Äèñïåò÷åð çàâäàíü ReactOS"
+CAPTION "Äèñïåò÷åð çàâäàíü"
MENU IDR_TASKMANAGER
FONT 8, "MS Shell Dlg"
BEGIN
Modified: trunk/reactos/base/applications/taskmgr/lang/zh-CN.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/lang/zh-CN.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/lang/zh-CN.rc [iso-8859-1] Tue Dec 29 18:55:44
2009
@@ -173,7 +173,7 @@
STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP |
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU |
WS_THICKFRAME
-CAPTION "ReactOS ÈÎÎñ¹ÜÀíÆ÷"
+CAPTION "ÈÎÎñ¹ÜÀíÆ÷"
MENU IDR_TASKMANAGER
FONT 8, "MS Shell Dlg"
BEGIN
Modified: trunk/reactos/base/applications/taskmgr/taskmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/taskmgr.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/taskmgr.c [iso-8859-1] Tue Dec 29 18:55:44
2009
@@ -55,8 +55,27 @@
/* check wether we're already running or not */
hMutex = CreateMutexW(NULL, TRUE, L"taskmgrros");
- if ((!hMutex) || (GetLastError() == ERROR_ALREADY_EXISTS))
+ if (hMutex && GetLastError() == ERROR_ALREADY_EXISTS)
+ {
+ /* Restore existing taskmanager and bring window to front */
+ /* Relies on the fact that the application title string and window title are the
same */
+ HWND hTaskMgr;
+ TCHAR szTaskmgr[128];
+
+ LoadString(hInst, IDS_APP_TITLE, szTaskmgr, sizeof(szTaskmgr)/sizeof(TCHAR));
+ hTaskMgr = FindWindow(NULL, szTaskmgr);
+
+ if (hTaskMgr != NULL)
+ {
+ SendMessage(hTaskMgr, WM_SYSCOMMAND, SC_RESTORE, 0);
+ SetForegroundWindow(hTaskMgr);
+ }
+ return 0;
+ }
+ else if (!hMutex)
+ {
return 1;
+ }
/* Initialize global variables */
hInst = hInstance;