Commit 282dac43 authored by Aurimas Fišeras's avatar Aurimas Fišeras Committed by Alexandre Julliard

taskmgr: Make MessageBoxes translatable.

parent ee9baf28
......@@ -533,3 +533,24 @@ BEGIN
IDS_IOOTHER "I/O Other"
IDS_IOOTHERBYTES "I/O Other Bytes"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_WARNING_TITLE "Task Manager Warning"
IDS_PRIORITY_CHANGE_MESSAGE "WARNING: Changing the priority class of this process may\n\
cause undesired results including system instability. Are you\n\
sure you want to change the priority class?"
IDS_PRIORITY_UNABLE2CHANGE "Unable to Change Priority"
IDS_TERMINATE_MESSAGE "WARNING: Terminating a process can cause undesired\n\
results including loss of data and system instability. The\n\
process will not be given the chance to save its state or\n\
data before it is terminated. Are you sure you want to\n\
terminate the process?"
IDS_TERMINATE_UNABLE2TERMINATE "Unable to Terminate Process"
IDS_DEBUG_MESSAGE "WARNING: Debugging this process may result in loss of data.\n\
Are you sure you wish to attach the debugger?"
IDS_DEBUG_UNABLE2DEBUG "Unable to Debug Process"
IDS_AFFINITY_ERROR_MESSAGE "The process must have affinity with at least one processor"
IDS_AFFINITY_ERROR_TITLE "Invalid Option"
IDS_AFFINITY_UNABLE2ACCESS "Unable to Access or Set Process Affinity"
END
......@@ -35,10 +35,7 @@
HANDLE hProcessAffinityHandle;
static const WCHAR wszUnable2Access[] = {'U','n','a','b','l','e',' ','t','o',' ',
'A','c','c','e','s','s',' ','o','r',' ',
'S','e','t',' ','P','r','o','c','e','s','s',' ',
'A','f','f','i','n','i','t','y',0};
WCHAR wszUnable2Access[255];
static INT_PTR CALLBACK
AffinityDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
......@@ -57,6 +54,7 @@ AffinityDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
if (!GetProcessAffinityMask(hProcessAffinityHandle, &dwProcessAffinityMask, &dwSystemAffinityMask)) {
GetLastErrorText(wstrErrorText, sizeof(wstrErrorText)/sizeof(WCHAR));
EndDialog(hDlg, 0);
LoadStringW(hInst, IDS_AFFINITY_UNABLE2ACCESS, wszUnable2Access, sizeof(wszUnable2Access)/sizeof(WCHAR));
MessageBoxW(hMainWnd, wstrErrorText, wszUnable2Access, MB_OK|MB_ICONSTOP);
}
......@@ -292,12 +290,10 @@ AffinityDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
* of it's cpu time.
*/
if (!dwProcessAffinityMask) {
static const WCHAR wszErrorMsg[] = {'T','h','e',' ','p','r','o','c','e','s','s',' ',
'm','u','s','t',' ','h','a','v','e',' ',
'a','f','f','i','n','i','t','y',' ',
'w','i','t','h',' ','a','t',' ','l','e','a','s','t',' ',
'o','n','e',' ','p','r','o','c','e','s','s','o','r','.',0};
static const WCHAR wszErrorTitle[] = {'I','n','v','a','l','i','d',' ','O','p','t','i','o','n',0};
WCHAR wszErrorMsg[255];
WCHAR wszErrorTitle[255];
LoadStringW(hInst, IDS_AFFINITY_ERROR_MESSAGE, wszErrorMsg, sizeof(wszErrorMsg)/sizeof(WCHAR));
LoadStringW(hInst, IDS_AFFINITY_ERROR_TITLE, wszErrorTitle, sizeof(wszErrorTitle)/sizeof(WCHAR));
MessageBoxW(hDlg, wszErrorMsg, wszErrorTitle, MB_OK|MB_ICONSTOP);
return TRUE;
}
......@@ -308,6 +304,7 @@ AffinityDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
if (!SetProcessAffinityMask(hProcessAffinityHandle, dwProcessAffinityMask)) {
GetLastErrorText(wstrErrorText, sizeof(wstrErrorText)/sizeof(WCHAR));
EndDialog(hDlg, LOWORD(wParam));
LoadStringW(hInst, IDS_AFFINITY_UNABLE2ACCESS, wszUnable2Access, sizeof(wszUnable2Access)/sizeof(WCHAR));
MessageBoxW(hMainWnd, wstrErrorText, wszUnable2Access, MB_OK|MB_ICONSTOP);
}
......@@ -343,6 +340,7 @@ void ProcessPage_OnSetAffinity(void)
hProcessAffinityHandle = OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_SET_INFORMATION, FALSE, dwProcessId);
if (!hProcessAffinityHandle) {
GetLastErrorText(wstrErrorText, sizeof(wstrErrorText)/sizeof(WCHAR));
LoadStringW(hInst, IDS_AFFINITY_UNABLE2ACCESS, wszUnable2Access, sizeof(wszUnable2Access)/sizeof(WCHAR));
MessageBoxW(hMainWnd, wstrErrorText, wszUnable2Access, MB_OK|MB_ICONSTOP);
return;
}
......
......@@ -47,22 +47,20 @@ void ProcessPage_OnDebug(void)
STARTUPINFOW si;
HANDLE hDebugEvent;
static const WCHAR wszWarnTitle[] = {'T','a','s','k',' ','M','a','n','a','g','e','r',' ',
'W','a','r','n','i','n','g',0};
static const WCHAR wszUnable2Debug[] = {'U','n','a','b','l','e',' ','t','o',' ','D','e','b','u','g',' ',
'P','r','o','c','e','s','s',0};
WCHAR wszWarnTitle[255];
WCHAR wszUnable2Debug[255];
WCHAR wszWarnMsg[255];
static const WCHAR wszSubKey[] = {'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'W','i','n','d','o','w','s',' ','N','T','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
'A','e','D','e','b','u','g',0};
static const WCHAR wszDebugger[] = {'D','e','b','u','g','g','e','r',0};
static const WCHAR wszWarnMsg[] = {'W','A','R','N','I','N','G',':',' ','D','e','b','u','g','g','i','n','g',' ',
't','h','i','s',' ','p','r','o','c','e','s','s',' ','m','a','y',' ',
'r','e','s','u','l','t',' ','i','n',' ','l','o','s','s',' ','o','f',' ',
'd','a','t','a','.','\n','A','r','e',' ','y','o','u',' ','s','u','r','e',' ',
'y','o','u',' ','w','i','s','h',' ','t','o',' ','a','t','t','a','c','h',' ',
't','h','e',' ','d','e','b','u','g','g','e','r','?',0};
LoadStringW(hInst, IDS_WARNING_TITLE, wszWarnTitle, sizeof(wszWarnTitle)/sizeof(WCHAR));
LoadStringW(hInst, IDS_DEBUG_UNABLE2DEBUG, wszUnable2Debug, sizeof(wszUnable2Debug)/sizeof(WCHAR));
LoadStringW(hInst, IDS_DEBUG_MESSAGE, wszWarnMsg, sizeof(wszWarnMsg)/sizeof(WCHAR));
for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++)
{
......
......@@ -33,9 +33,16 @@
#include "taskmgr.h"
#include "perfdata.h"
static const WCHAR wszWarnMsg[] = {'W','A','R','N','I','N','G',':',' ','T','e','r','m','i','n','a','t','i','n','g',' ','a',' ','p','r','o','c','e','s','s',' ','c','a','n',' ','c','a','u','s','e',' ','u','n','d','e','s','i','r','e','d','\n','r','e','s','u','l','t','s',' ','i','n','c','l','u','d','i','n','g',' ','l','o','s','s',' ','o','f',' ','d','a','t','a',' ','a','n','d',' ','s','y','s','t','e','m',' ','i','n','s','t','a','b','i','l','i','t','y','.',' ','T','h','e','\n','p','r','o','c','e','s','s',' ','w','i','l','l',' ','n','o','t',' ','b','e',' ','g','i','v','e','n',' ','t','h','e',' ','c','h','a','n','c','e',' ','t','o',' ','s','a','v','e',' ','i','t','s',' ','s','t','a','t','e',' ','o','r','\n','d','a','t','a',' ','b','e','f','o','r','e',' ','i','t',' ','i','s',' ','t','e','r','m','i','n','a','t','e','d','.',' ','A','r','e',' ','y','o','u',' ','s','u','r','e',' ','y','o','u',' ','w','a','n','t',' ','t','o','\n','t','e','r','m','i','n','a','t','e',' ','t','h','e',' ','p','r','o','c','e','s','s','?',0};
static const WCHAR wszWarnTitle[] = {'T','a','s','k',' ','M','a','n','a','g','e','r',' ','W','a','r','n','i','n','g',0};
static const WCHAR wszUnable2Terminate[] = {'U','n','a','b','l','e',' ','t','o',' ','T','e','r','m','i','n','a','t','e',' ','P','r','o','c','e','s','s',0};
WCHAR wszWarnMsg[511];
WCHAR wszWarnTitle[255];
WCHAR wszUnable2Terminate[255];
static void load_message_strings(void)
{
LoadStringW(hInst, IDS_TERMINATE_MESSAGE, wszWarnMsg, sizeof(wszWarnMsg)/sizeof(WCHAR));
LoadStringW(hInst, IDS_TERMINATE_UNABLE2TERMINATE, wszUnable2Terminate, sizeof(wszUnable2Terminate)/sizeof(WCHAR));
LoadStringW(hInst, IDS_WARNING_TITLE, wszWarnTitle, sizeof(wszWarnTitle)/sizeof(WCHAR));
}
void ProcessPage_OnEndProcess(void)
{
......@@ -45,6 +52,8 @@ void ProcessPage_OnEndProcess(void)
HANDLE hProcess;
WCHAR wstrErrorText[256];
load_message_strings();
for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++)
{
lvitem.mask = LVIF_STATE;
......@@ -92,6 +101,8 @@ void ProcessPage_OnEndProcessTree(void)
HANDLE hProcess;
WCHAR wstrErrorText[256];
load_message_strings();
for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++)
{
lvitem.mask = LVIF_STATE;
......
......@@ -41,10 +41,13 @@ static void DoSetPriority(DWORD priority)
HANDLE hProcess;
WCHAR wstrErrorText[256];
static const WCHAR wszWarnMsg[] = {'W','A','R','N','I','N','G',':',' ','C','h','a','n','g','i','n','g',
' ','t','h','e',' ','p','r','i','o','r','i','t','y',' ','c','l','a','s','s',' ','o','f',' ','t','h','i','s',' ','p','r','o','c','e','s','s',' ','m','a','y','\n','c','a','u','s','e',' ','u','n','d','e','s','i','r','e','d',' ','r','e','s','u','l','t','s',' ','i','n','c','l','u','d','i','n','g',' ','s','y','s','t','e','m',' ','i','n','s','t','a','b','i','l','i','t','y','.',' ','A','r','e',' ','y','o','u','\n','s','u','r','e',' ','y','o','u',' ','w','a','n','t',' ','t','o',' ','c','h','a','n','g','e',' ','t','h','e',' ','p','r','i','o','r','i','t','y',' ','c','l','a','s','s','?',0};
static const WCHAR wszWarnTitle[] = {'T','a','s','k',' ','M','a','n','a','g','e','r',' ','W','a','r','n','i','n','g',0};
static const WCHAR wszUnable2Change[] = {'U','n','a','b','l','e',' ','t','o',' ','C','h','a','n','g','e',' ','P','r','i','o','r','i','t','y',0};
WCHAR wszWarnMsg[255];
WCHAR wszWarnTitle[255];
WCHAR wszUnable2Change[255];
LoadStringW(hInst, IDS_PRIORITY_CHANGE_MESSAGE, wszWarnMsg, sizeof(wszWarnMsg)/sizeof(WCHAR));
LoadStringW(hInst, IDS_WARNING_TITLE, wszWarnTitle, sizeof(wszWarnTitle)/sizeof(WCHAR));
LoadStringW(hInst, IDS_PRIORITY_UNABLE2CHANGE, wszUnable2Change, sizeof(wszUnable2Change)/sizeof(WCHAR));
for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++)
{
......
......@@ -223,6 +223,16 @@
#define IDS_IOWRITEBYTES 32854
#define IDS_IOOTHER 32855
#define IDS_IOOTHERBYTES 32856
#define IDS_WARNING_TITLE 32857
#define IDS_PRIORITY_CHANGE_MESSAGE 32858
#define IDS_PRIORITY_UNABLE2CHANGE 32859
#define IDS_TERMINATE_MESSAGE 32860
#define IDS_TERMINATE_UNABLE2TERMINATE 32861
#define IDS_DEBUG_MESSAGE 32862
#define IDS_DEBUG_UNABLE2DEBUG 32863
#define IDS_AFFINITY_ERROR_MESSAGE 32864
#define IDS_AFFINITY_ERROR_TITLE 32865
#define IDS_AFFINITY_UNABLE2ACCESS 32866
#define IDC_STATIC -1
/*
......
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