Commit 88a08f91 authored by Aurimas Fišeras's avatar Aurimas Fišeras Committed by Alexandre Julliard

taskmgr: Make status bar text translatable.

parent 7490f922
...@@ -500,4 +500,7 @@ BEGIN ...@@ -500,4 +500,7 @@ BEGIN
IDS_APPLICATIONS "Applications" IDS_APPLICATIONS "Applications"
IDS_PROCESSES "Processes" IDS_PROCESSES "Processes"
IDS_PERFORMANCE "Performance" IDS_PERFORMANCE "Performance"
IDS_STATUS_BAR_CPU_USAGE "CPU Usage: %3d%%"
IDS_STATUS_BAR_PROCESSES "Processes: %d"
IDS_STATUS_BAR_MEMORY_USAGE "Mem Usage: %dK / %dK"
END END
...@@ -141,8 +141,9 @@ static DWORD WINAPI PerformancePageRefreshThread(void *lpParameter) ...@@ -141,8 +141,9 @@ static DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
WCHAR Text[256]; WCHAR Text[256];
static const WCHAR wszFormatDigit[] = {'%','d',0}; static const WCHAR wszFormatDigit[] = {'%','d',0};
static const WCHAR wszMemUsage[] = {'M','e','m',' ','U','s','a','g','e',':',' ', WCHAR wszMemUsage[255];
'%','d','K',' ','/',' ','%','d','K',0};
LoadStringW(hInst, IDS_STATUS_BAR_MEMORY_USAGE, wszMemUsage, sizeof(wszMemUsage)/sizeof(WCHAR));
/* Create the event */ /* Create the event */
hPerformancePageEvent = CreateEvent(NULL, TRUE, TRUE, NULL); hPerformancePageEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
......
...@@ -386,6 +386,12 @@ static DWORD WINAPI ProcessPageRefreshThread(void *lpParameter) ...@@ -386,6 +386,12 @@ static DWORD WINAPI ProcessPageRefreshThread(void *lpParameter)
ULONG OldProcessorUsage = 0; ULONG OldProcessorUsage = 0;
ULONG OldProcessCount = 0; ULONG OldProcessCount = 0;
WCHAR wszCPU_Usage[255];
WCHAR wszProcesses[255];
LoadStringW(hInst, IDS_STATUS_BAR_CPU_USAGE, wszCPU_Usage, sizeof(wszCPU_Usage)/sizeof(WCHAR));
LoadStringW(hInst, IDS_STATUS_BAR_PROCESSES, wszProcesses, sizeof(wszProcesses)/sizeof(WCHAR));
/* Create the event */ /* Create the event */
hProcessPageEvent = CreateEvent(NULL, TRUE, TRUE, NULL); hProcessPageEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
...@@ -405,7 +411,7 @@ static DWORD WINAPI ProcessPageRefreshThread(void *lpParameter) ...@@ -405,7 +411,7 @@ static DWORD WINAPI ProcessPageRefreshThread(void *lpParameter)
return 0; return 0;
if (dwWaitVal == WAIT_OBJECT_0) { if (dwWaitVal == WAIT_OBJECT_0) {
TCHAR text[260]; WCHAR text[256];
/* Reset our event */ /* Reset our event */
ResetEvent(hProcessPageEvent); ResetEvent(hProcessPageEvent);
...@@ -418,13 +424,13 @@ static DWORD WINAPI ProcessPageRefreshThread(void *lpParameter) ...@@ -418,13 +424,13 @@ static DWORD WINAPI ProcessPageRefreshThread(void *lpParameter)
if (OldProcessorUsage != PerfDataGetProcessorUsage()) { if (OldProcessorUsage != PerfDataGetProcessorUsage()) {
OldProcessorUsage = PerfDataGetProcessorUsage(); OldProcessorUsage = PerfDataGetProcessorUsage();
wsprintf(text, _T("CPU Usage: %3d%%"), OldProcessorUsage); wsprintfW(text, wszCPU_Usage, OldProcessorUsage);
SendMessage(hStatusWnd, SB_SETTEXT, 1, (LPARAM)text); SendMessageW(hStatusWnd, SB_SETTEXTW, 1, (LPARAM)text);
} }
if (OldProcessCount != PerfDataGetProcessCount()) { if (OldProcessCount != PerfDataGetProcessCount()) {
OldProcessCount = PerfDataGetProcessCount(); OldProcessCount = PerfDataGetProcessCount();
wsprintf(text, _T("Processes: %d"), OldProcessCount); wsprintfW(text, wszProcesses, OldProcessCount);
SendMessage(hStatusWnd, SB_SETTEXT, 0, (LPARAM)text); SendMessageW(hStatusWnd, SB_SETTEXTW, 0, (LPARAM)text);
} }
} }
} }
......
...@@ -195,6 +195,9 @@ ...@@ -195,6 +195,9 @@
#define IDS_APPLICATIONS 32826 #define IDS_APPLICATIONS 32826
#define IDS_PROCESSES 32827 #define IDS_PROCESSES 32827
#define IDS_PERFORMANCE 32828 #define IDS_PERFORMANCE 32828
#define IDS_STATUS_BAR_CPU_USAGE 32829
#define IDS_STATUS_BAR_PROCESSES 32830
#define IDS_STATUS_BAR_MEMORY_USAGE 32831
#define IDC_STATIC -1 #define IDC_STATIC -1
/* /*
......
...@@ -527,8 +527,11 @@ static void TaskManager_OnExitMenuLoop(HWND hWnd) ...@@ -527,8 +527,11 @@ static void TaskManager_OnExitMenuLoop(HWND hWnd)
int nParts[3]; int nParts[3];
WCHAR text[256]; WCHAR text[256];
static const WCHAR wszCPU_Usage[] = {'C','P','U',' ','U','s','a','g','e',':',' ','%','3','d','%','%',0}; WCHAR wszCPU_Usage[255];
static const WCHAR wszProcesses[] = {'P','r','o','c','e','s','s','e','s',':',' ','%','d',0}; WCHAR wszProcesses[255];
LoadStringW(hInst, IDS_STATUS_BAR_CPU_USAGE, wszCPU_Usage, sizeof(wszCPU_Usage)/sizeof(WCHAR));
LoadStringW(hInst, IDS_STATUS_BAR_PROCESSES, wszProcesses, sizeof(wszProcesses)/sizeof(WCHAR));
bInMenuLoop = FALSE; bInMenuLoop = FALSE;
/* Update the status bar pane sizes */ /* Update the status bar pane sizes */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment