From 65305e49680d51b6369c590f00959b3baeab22a1 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sun, 8 May 2005 18:20:39 +0000 Subject: [PATCH] Remove two hardcode string to En.rc it is IDS_Not_Responding, IDS_Running thx irc: potapnik for notice one of them svn path=/trunk/; revision=15144 --- reactos/subsys/system/taskmgr/En.rc | 2 ++ reactos/subsys/system/taskmgr/applpage.c | 11 +++++++++-- reactos/subsys/system/taskmgr/resource.h | 2 ++ reactos/subsys/system/taskmgr/trayicon.c | 6 +++++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/reactos/subsys/system/taskmgr/En.rc b/reactos/subsys/system/taskmgr/En.rc index 9ad69e3a495..a7f111c0a1b 100644 --- a/reactos/subsys/system/taskmgr/En.rc +++ b/reactos/subsys/system/taskmgr/En.rc @@ -664,6 +664,8 @@ BEGIN IDS_STATUS_MEMUSAGE "Mem Usage: %dK / %dK" IDS_STATUS_CPUUSAGE "CPU Usage: %3d%%" IDS_STATUS_PROCESSES "Processes: %d" + IDS_Not_Responding "Not Responding" + IDS_Running "Running" END diff --git a/reactos/subsys/system/taskmgr/applpage.c b/reactos/subsys/system/taskmgr/applpage.c index 2b929e2534f..7357eece480 100644 --- a/reactos/subsys/system/taskmgr/applpage.c +++ b/reactos/subsys/system/taskmgr/applpage.c @@ -489,6 +489,7 @@ void ApplicationPageOnNotify(WPARAM wParam, LPARAM lParam) LPNM_LISTVIEW pnmv; LV_DISPINFO* pnmdi; LPAPPLICATION_PAGE_LIST_ITEM pAPLI; + TCHAR szMsg[256]; idctrl = (int) wParam; @@ -515,9 +516,15 @@ void ApplicationPageOnNotify(WPARAM wParam, LPARAM lParam) else if (pnmdi->item.iSubItem == 1) { if (pAPLI->bHung) - _tcsncpy(pnmdi->item.pszText, _T("Not Responding"), pnmdi->item.cchTextMax); + { + LoadString( GetModuleHandle(NULL), IDS_Not_Responding , (LPTSTR) szMsg,sizeof(szMsg)); + _tcsncpy(pnmdi->item.pszText, szMsg, pnmdi->item.cchTextMax); + } else - _tcsncpy(pnmdi->item.pszText, _T("Running"), pnmdi->item.cchTextMax); + { + LoadString( GetModuleHandle(NULL), IDS_Running, (LPTSTR) szMsg,sizeof(szMsg)); + _tcsncpy(pnmdi->item.pszText, szMsg, pnmdi->item.cchTextMax); + } } break; diff --git a/reactos/subsys/system/taskmgr/resource.h b/reactos/subsys/system/taskmgr/resource.h index 921707a35f2..b9a0e297a3f 100644 --- a/reactos/subsys/system/taskmgr/resource.h +++ b/reactos/subsys/system/taskmgr/resource.h @@ -240,6 +240,8 @@ #define IDS_STATUS_MEMUSAGE 363 #define IDS_STATUS_CPUUSAGE 364 #define IDS_STATUS_PROCESSES 365 +#define IDS_Not_Responding 366 +#define IDS_Running 367 // Next default values for new objects diff --git a/reactos/subsys/system/taskmgr/trayicon.c b/reactos/subsys/system/taskmgr/trayicon.c index 79f8bf8898f..48b3f6dbe91 100644 --- a/reactos/subsys/system/taskmgr/trayicon.c +++ b/reactos/subsys/system/taskmgr/trayicon.c @@ -135,6 +135,7 @@ BOOL TrayIcon_ShellAddTrayIcon(void) NOTIFYICONDATA nid; HICON hIcon = NULL; BOOL bRetVal; + TCHAR szMsg[256]; memset(&nid, 0, sizeof(NOTIFYICONDATA)); @@ -146,7 +147,10 @@ BOOL TrayIcon_ShellAddTrayIcon(void) nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; nid.uCallbackMessage = WM_ONTRAYICON; nid.hIcon = hIcon; - wsprintf(nid.szTip, _T("CPU Usage: %d%%"), PerfDataGetProcessorUsage()); + + + LoadString( GetModuleHandle(NULL), IDS_MSG_TRAYICONCPUUSAGE, (LPTSTR) szMsg,sizeof(szMsg)); + wsprintf(nid.szTip, szMsg, PerfDataGetProcessorUsage()); bRetVal = Shell_NotifyIcon(NIM_ADD, &nid);