taskmgr: Make status bar text translatable.
This commit is contained in:
parent
7490f922e0
commit
88a08f91c9
|
@ -500,4 +500,7 @@ BEGIN
|
|||
IDS_APPLICATIONS "Applications"
|
||||
IDS_PROCESSES "Processes"
|
||||
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
|
||||
|
|
|
@ -141,8 +141,9 @@ static DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
|
|||
WCHAR Text[256];
|
||||
|
||||
static const WCHAR wszFormatDigit[] = {'%','d',0};
|
||||
static const WCHAR wszMemUsage[] = {'M','e','m',' ','U','s','a','g','e',':',' ',
|
||||
'%','d','K',' ','/',' ','%','d','K',0};
|
||||
WCHAR wszMemUsage[255];
|
||||
|
||||
LoadStringW(hInst, IDS_STATUS_BAR_MEMORY_USAGE, wszMemUsage, sizeof(wszMemUsage)/sizeof(WCHAR));
|
||||
|
||||
/* Create the event */
|
||||
hPerformancePageEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
|
||||
|
|
|
@ -386,6 +386,12 @@ static DWORD WINAPI ProcessPageRefreshThread(void *lpParameter)
|
|||
ULONG OldProcessorUsage = 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 */
|
||||
hProcessPageEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
|
||||
|
||||
|
@ -405,7 +411,7 @@ static DWORD WINAPI ProcessPageRefreshThread(void *lpParameter)
|
|||
return 0;
|
||||
|
||||
if (dwWaitVal == WAIT_OBJECT_0) {
|
||||
TCHAR text[260];
|
||||
WCHAR text[256];
|
||||
|
||||
/* Reset our event */
|
||||
ResetEvent(hProcessPageEvent);
|
||||
|
@ -418,13 +424,13 @@ static DWORD WINAPI ProcessPageRefreshThread(void *lpParameter)
|
|||
|
||||
if (OldProcessorUsage != PerfDataGetProcessorUsage()) {
|
||||
OldProcessorUsage = PerfDataGetProcessorUsage();
|
||||
wsprintf(text, _T("CPU Usage: %3d%%"), OldProcessorUsage);
|
||||
SendMessage(hStatusWnd, SB_SETTEXT, 1, (LPARAM)text);
|
||||
wsprintfW(text, wszCPU_Usage, OldProcessorUsage);
|
||||
SendMessageW(hStatusWnd, SB_SETTEXTW, 1, (LPARAM)text);
|
||||
}
|
||||
if (OldProcessCount != PerfDataGetProcessCount()) {
|
||||
OldProcessCount = PerfDataGetProcessCount();
|
||||
wsprintf(text, _T("Processes: %d"), OldProcessCount);
|
||||
SendMessage(hStatusWnd, SB_SETTEXT, 0, (LPARAM)text);
|
||||
wsprintfW(text, wszProcesses, OldProcessCount);
|
||||
SendMessageW(hStatusWnd, SB_SETTEXTW, 0, (LPARAM)text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -195,6 +195,9 @@
|
|||
#define IDS_APPLICATIONS 32826
|
||||
#define IDS_PROCESSES 32827
|
||||
#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
|
||||
|
||||
/*
|
||||
|
|
|
@ -527,8 +527,11 @@ static void TaskManager_OnExitMenuLoop(HWND hWnd)
|
|||
int nParts[3];
|
||||
WCHAR text[256];
|
||||
|
||||
static const WCHAR wszCPU_Usage[] = {'C','P','U',' ','U','s','a','g','e',':',' ','%','3','d','%','%',0};
|
||||
static const WCHAR wszProcesses[] = {'P','r','o','c','e','s','s','e','s',':',' ','%','d',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));
|
||||
|
||||
bInMenuLoop = FALSE;
|
||||
/* Update the status bar pane sizes */
|
||||
|
|
Loading…
Reference in New Issue