From 58df0924252b48e0ce0f76b325fbb0ea1bc06941 Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Fri, 9 Nov 2007 15:26:02 +0000 Subject: [PATCH] Many more conversions to Unicode function and type names for taskmgr svn path=/trunk/; revision=30297 --- reactos/base/applications/taskmgr/about.c | 6 +- reactos/base/applications/taskmgr/affinity.c | 24 ++-- reactos/base/applications/taskmgr/applpage.c | 48 +++---- reactos/base/applications/taskmgr/column.c | 38 ++--- reactos/base/applications/taskmgr/dbgchnl.c | 10 +- reactos/base/applications/taskmgr/debug.c | 42 +++--- reactos/base/applications/taskmgr/endproc.c | 28 ++-- reactos/base/applications/taskmgr/graph.c | 14 +- reactos/base/applications/taskmgr/graphctl.c | 2 +- reactos/base/applications/taskmgr/optnmenu.c | 2 +- reactos/base/applications/taskmgr/perfdata.c | 10 +- reactos/base/applications/taskmgr/perfpage.c | 40 +++--- reactos/base/applications/taskmgr/priority.c | 84 +++++------ reactos/base/applications/taskmgr/proclist.c | 10 +- reactos/base/applications/taskmgr/procpage.c | 80 +++++------ reactos/base/applications/taskmgr/run.c | 6 +- reactos/base/applications/taskmgr/taskmgr.c | 138 +++++++++---------- reactos/base/applications/taskmgr/trayicon.c | 36 ++--- 18 files changed, 309 insertions(+), 309 deletions(-) diff --git a/reactos/base/applications/taskmgr/about.c b/reactos/base/applications/taskmgr/about.c index a935d23bf18..7ff3f9911a6 100644 --- a/reactos/base/applications/taskmgr/about.c +++ b/reactos/base/applications/taskmgr/about.c @@ -26,7 +26,7 @@ INT_PTR CALLBACK AboutDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPAR void OnAbout(void) { - DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hMainWnd, AboutDialogWndProc); + DialogBoxW(hInst, MAKEINTRESOURCEW(IDD_ABOUTBOX), hMainWnd, AboutDialogWndProc); } INT_PTR CALLBACK @@ -41,9 +41,9 @@ AboutDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) hLicenseEditWnd = GetDlgItem(hDlg, IDC_LICENSE_EDIT); - LoadString(hInst, IDS_LICENSE, strLicense, 0x1000); + LoadStringW(hInst, IDS_LICENSE, strLicense, 0x1000); - SetWindowText(hLicenseEditWnd, strLicense); + SetWindowTextW(hLicenseEditWnd, strLicense); return TRUE; diff --git a/reactos/base/applications/taskmgr/affinity.c b/reactos/base/applications/taskmgr/affinity.c index 0987f9b05ec..b13380e6f58 100644 --- a/reactos/base/applications/taskmgr/affinity.c +++ b/reactos/base/applications/taskmgr/affinity.c @@ -62,11 +62,11 @@ void ProcessPage_OnSetAffinity(void) hProcessAffinityHandle = OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_SET_INFORMATION, FALSE, dwProcessId); if (!hProcessAffinityHandle) { GetLastErrorText(strErrorText, sizeof(strErrorText) / sizeof(WCHAR)); - LoadString(hInst, IDS_MSG_ACCESSPROCESSAFF, szTemp, sizeof(szTemp) / sizeof(WCHAR)); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_ACCESSPROCESSAFF, szTemp, sizeof(szTemp) / sizeof(WCHAR)); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); return; } - DialogBox(hInst, MAKEINTRESOURCE(IDD_AFFINITY_DIALOG), hMainWnd, AffinityDialogWndProc); + DialogBoxW(hInst, MAKEINTRESOURCEW(IDD_AFFINITY_DIALOG), hMainWnd, AffinityDialogWndProc); if (hProcessAffinityHandle) { CloseHandle(hProcessAffinityHandle); hProcessAffinityHandle = NULL; @@ -91,8 +91,8 @@ AffinityDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) if (!GetProcessAffinityMask(hProcessAffinityHandle, &dwProcessAffinityMask, &dwSystemAffinityMask)) { GetLastErrorText(strErrorText, sizeof(strErrorText) / sizeof(WCHAR)); EndDialog(hDlg, 0); - LoadString(hInst, IDS_MSG_ACCESSPROCESSAFF, szTemp, sizeof(szTemp) / sizeof(WCHAR)); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_ACCESSPROCESSAFF, szTemp, sizeof(szTemp) / sizeof(WCHAR)); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); } for (nCpu=0; nCpuhIcon != hIcon) || - (wcsicmp(pAPLI->szTitle, szTitle) != 0) || + (_wcsicmp(pAPLI->szTitle, szTitle) != 0) || (pAPLI->bHung != bHung)) { /* Update the structure */ @@ -397,7 +397,7 @@ void AddOrUpdateHwnd(HWND hWnd, WCHAR *szTitle, HICON hIcon, BOOL bHung) !IsWindowVisible(pAPLI->hWnd) || (GetParent(pAPLI->hWnd) != NULL) || (GetWindow(pAPLI->hWnd, GW_OWNER) != NULL) || - (GetWindowLong(hWnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW)) + (GetWindowLongW(hWnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW)) { ImageList_Remove(hImageListLarge, item.iItem); ImageList_Remove(hImageListSmall, item.iItem); @@ -520,12 +520,12 @@ void ApplicationPageOnNotify(WPARAM wParam, LPARAM lParam) { if (pAPLI->bHung) { - LoadString( GetModuleHandle(NULL), IDS_Not_Responding , szMsg, sizeof(szMsg) / sizeof(szMsg[0])); + LoadStringW( GetModuleHandleW(NULL), IDS_Not_Responding , szMsg, sizeof(szMsg) / sizeof(szMsg[0])); wcsncpy(pnmdi->item.pszText, szMsg, pnmdi->item.cchTextMax); } else { - LoadString( GetModuleHandle(NULL), IDS_Running, (LPTSTR) szMsg, sizeof(szMsg) / sizeof(szMsg[0])); + LoadStringW( GetModuleHandleW(NULL), IDS_Running, (LPWSTR) szMsg, sizeof(szMsg) / sizeof(szMsg[0])); wcsncpy(pnmdi->item.pszText, szMsg, pnmdi->item.cchTextMax); } } @@ -588,7 +588,7 @@ void ApplicationPageShowContextMenu1(void) GetCursorPos(&pt); - hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_APPLICATION_PAGE_CONTEXT1)); + hMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_APPLICATION_PAGE_CONTEXT1)); hSubMenu = GetSubMenu(hMenu, 0); if (TaskManagerSettings.View_LargeIcons) @@ -611,7 +611,7 @@ void ApplicationPageShowContextMenu2(void) GetCursorPos(&pt); - hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_APPLICATION_PAGE_CONTEXT2)); + hMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_APPLICATION_PAGE_CONTEXT2)); hSubMenu = GetSubMenu(hMenu, 0); if (ListView_GetSelectedCount(hApplicationPageListCtrl) == 1) @@ -876,7 +876,7 @@ void ApplicationPage_OnSwitchTo(void) typedef void (WINAPI *PROCSWITCHTOTHISWINDOW) (HWND, BOOL); PROCSWITCHTOTHISWINDOW SwitchToThisWindow; - HMODULE hUser32 = GetModuleHandle(L"USER32"); + HMODULE hUser32 = GetModuleHandleW(L"USER32"); SwitchToThisWindow = (PROCSWITCHTOTHISWINDOW)GetProcAddress(hUser32, "SwitchToThisWindow"); if (SwitchToThisWindow) { SwitchToThisWindow(pAPLI->hWnd, TRUE); @@ -906,7 +906,7 @@ void ApplicationPage_OnEndTask(void) if (item.state & LVIS_SELECTED) { pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam; if (pAPLI) { - PostMessage(pAPLI->hWnd, WM_CLOSE, 0, 0); + PostMessageW(pAPLI->hWnd, WM_CLOSE, 0, 0); } } } diff --git a/reactos/base/applications/taskmgr/column.c b/reactos/base/applications/taskmgr/column.c index 24091a2a4d3..9e25fd11abd 100644 --- a/reactos/base/applications/taskmgr/column.c +++ b/reactos/base/applications/taskmgr/column.c @@ -57,7 +57,7 @@ const PresetColumnEntry ColumnPresets[COLUMN_NMAX] = { DECLARE_COLUMN_PRESET(IOOTHERBYTES, 70, FALSE) }; -int InsertColumn(int nCol, LPCTSTR lpszColumnHeading, int nFormat, int nWidth, int nSubItem); +int InsertColumn(int nCol, LPCWSTR lpszColumnHeading, int nFormat, int nWidth, int nSubItem); INT_PTR CALLBACK ColumnsDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); void AddColumns(void) @@ -68,23 +68,23 @@ void AddColumns(void) for (n=0; n=0; i--) { @@ -172,7 +172,7 @@ ColumnsDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) for (i=0; iptAction; hChannelLV = GetDlgItem(hDlg, IDC_DEBUG_CHANNELS_LIST); - SendMessage(hChannelLV, LVM_SUBITEMHITTEST, 0, (LPARAM)&lhti); + SendMessageW(hChannelLV, LVM_SUBITEMHITTEST, 0, (LPARAM)&lhti); if (nmia->iSubItem >= 1 && nmia->iSubItem <= 4) { WCHAR val[2]; @@ -405,5 +405,5 @@ static INT_PTR CALLBACK DebugChannelsDlgProc(HWND hDlg, UINT message, WPARAM wPa void ProcessPage_OnDebugChannels(void) { - DialogBox(hInst, (LPCTSTR)IDD_DEBUG_CHANNELS_DIALOG, hMainWnd, DebugChannelsDlgProc); + DialogBoxW(hInst, (LPCWSTR)IDD_DEBUG_CHANNELS_DIALOG, hMainWnd, DebugChannelsDlgProc); } diff --git a/reactos/base/applications/taskmgr/debug.c b/reactos/base/applications/taskmgr/debug.c index 91c359ded19..9c1f8708a48 100644 --- a/reactos/base/applications/taskmgr/debug.c +++ b/reactos/base/applications/taskmgr/debug.c @@ -34,7 +34,7 @@ void ProcessPage_OnDebug(void) WCHAR strDebugger[260]; DWORD dwDebuggerSize; PROCESS_INFORMATION pi; - STARTUPINFO si; + STARTUPINFOW si; HANDLE hDebugEvent; WCHAR szTemp[256]; WCHAR szTempA[256]; @@ -59,56 +59,56 @@ void ProcessPage_OnDebug(void) if ((ListView_GetSelectedCount(hProcessPageListCtrl) != 1) || (dwProcessId == 0)) return; - LoadString(hInst, IDS_MSG_WARNINGDEBUG, szTemp, 256); - LoadString(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); + LoadStringW(hInst, IDS_MSG_WARNINGDEBUG, szTemp, 256); + LoadStringW(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); - if (MessageBox(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) + if (MessageBoxW(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLEDEBUGPROCESS, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLEDEBUGPROCESS, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); return; } - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug", 0, KEY_READ, &hKey) != ERROR_SUCCESS) + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug", 0, KEY_READ, &hKey) != ERROR_SUCCESS) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLEDEBUGPROCESS, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLEDEBUGPROCESS, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); return; } dwDebuggerSize = 260; - if (RegQueryValueEx(hKey, L"Debugger", NULL, NULL, (LPBYTE)strDebugger, &dwDebuggerSize) != ERROR_SUCCESS) + if (RegQueryValueExW(hKey, L"Debugger", NULL, NULL, (LPBYTE)strDebugger, &dwDebuggerSize) != ERROR_SUCCESS) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLEDEBUGPROCESS, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLEDEBUGPROCESS, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); RegCloseKey(hKey); return; } RegCloseKey(hKey); - hDebugEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + hDebugEvent = CreateEventW(NULL, FALSE, FALSE, NULL); if (!hDebugEvent) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLEDEBUGPROCESS, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLEDEBUGPROCESS, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); return; } - wsprintf(strDebugPath, strDebugger, dwProcessId, hDebugEvent); + wsprintfW(strDebugPath, strDebugger, dwProcessId, hDebugEvent); memset(&pi, 0, sizeof(PROCESS_INFORMATION)); - memset(&si, 0, sizeof(STARTUPINFO)); - si.cb = sizeof(STARTUPINFO); - if (!CreateProcess(NULL, strDebugPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) + memset(&si, 0, sizeof(STARTUPINFOW)); + si.cb = sizeof(STARTUPINFOW); + if (!CreateProcessW(NULL, strDebugPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLEDEBUGPROCESS, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLEDEBUGPROCESS, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); } CloseHandle(hDebugEvent); diff --git a/reactos/base/applications/taskmgr/endproc.c b/reactos/base/applications/taskmgr/endproc.c index af7e54a7d5a..627f78195ca 100644 --- a/reactos/base/applications/taskmgr/endproc.c +++ b/reactos/base/applications/taskmgr/endproc.c @@ -53,9 +53,9 @@ void ProcessPage_OnEndProcess(void) if ((ListView_GetSelectedCount(hProcessPageListCtrl) != 1) || (dwProcessId == 0)) return; - LoadString(hInst, IDS_MSG_WARNINGTERMINATING, szTemp, 256); - LoadString(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); - if (MessageBox(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) + LoadStringW(hInst, IDS_MSG_WARNINGTERMINATING, szTemp, 256); + LoadStringW(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); + if (MessageBoxW(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) return; hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, dwProcessId); @@ -63,16 +63,16 @@ void ProcessPage_OnEndProcess(void) if (!hProcess) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLETERMINATEPRO, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLETERMINATEPRO, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); return; } if (!TerminateProcess(hProcess, 0)) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLETERMINATEPRO, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLETERMINATEPRO, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); } CloseHandle(hProcess); @@ -105,9 +105,9 @@ void ProcessPage_OnEndProcessTree(void) if ((ListView_GetSelectedCount(hProcessPageListCtrl) != 1) || (dwProcessId == 0)) return; - LoadString(hInst, IDS_MSG_WARNINGTERMINATING, szTemp, 256); - LoadString(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); - if (MessageBox(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) + LoadStringW(hInst, IDS_MSG_WARNINGTERMINATING, szTemp, 256); + LoadStringW(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); + if (MessageBoxW(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) return; hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, dwProcessId); @@ -115,16 +115,16 @@ void ProcessPage_OnEndProcessTree(void) if (!hProcess) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLETERMINATEPRO, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLETERMINATEPRO, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); return; } if (!TerminateProcess(hProcess, 0)) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLETERMINATEPRO, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLETERMINATEPRO, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); } CloseHandle(hProcess); diff --git a/reactos/base/applications/taskmgr/graph.c b/reactos/base/applications/taskmgr/graph.c index 8727073ef29..6219497c1f2 100644 --- a/reactos/base/applications/taskmgr/graph.c +++ b/reactos/base/applications/taskmgr/graph.c @@ -102,7 +102,7 @@ Graph_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) hdc = BeginPaint(hWnd, &ps); - WindowId = GetWindowLong(hWnd, GWL_ID); + WindowId = GetWindowLongW(hWnd, GWL_ID); switch (WindowId) { @@ -126,7 +126,7 @@ Graph_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) /* * We pass on all non-handled messages */ - return CallWindowProc((WNDPROC)OldGraphWndProc, hWnd, message, wParam, lParam); + return CallWindowProcW((WNDPROC)OldGraphWndProc, hWnd, message, wParam, lParam); } void Graph_DrawCpuUsageGraph(HDC hDC, HWND hWnd) @@ -166,7 +166,7 @@ void Graph_DrawCpuUsageGraph(HDC hDC, HWND hWnd) if (CpuUsage <= 0) CpuUsage = 0; if (CpuUsage > 100) CpuUsage = 100; - wsprintf(Text, L"%d%%", (int)CpuUsage); + wsprintfW(Text, L"%d%%", (int)CpuUsage); /* * Draw the font text onto the graph @@ -175,7 +175,7 @@ void Graph_DrawCpuUsageGraph(HDC hDC, HWND hWnd) InflateRect(&rcText, -2, -2); crPrevForeground = SetTextColor(hDC, RGB(0, 255, 0)); hOldFont = SelectObject(hDC, GetStockObject(DEFAULT_GUI_FONT)); - DrawText(hDC, Text, -1, &rcText, DT_BOTTOM | DT_CENTER | DT_NOPREFIX | DT_SINGLELINE); + DrawTextW(hDC, Text, -1, &rcText, DT_BOTTOM | DT_CENTER | DT_NOPREFIX | DT_SINGLELINE); SelectObject(hDC, hOldFont); SetTextColor(hDC, crPrevForeground); @@ -335,9 +335,9 @@ void Graph_DrawMemUsageGraph(HDC hDC, HWND hWnd) CommitChargeLimit = (ULONGLONG)PerfDataGetCommitChargeLimitK(); if (CommitChargeTotal > 1024) - wsprintf(Text, L"%d MB", (int)(CommitChargeTotal / 1024)); + wsprintfW(Text, L"%d MB", (int)(CommitChargeTotal / 1024)); else - wsprintf(Text, L"%d K", (int)CommitChargeTotal); + wsprintfW(Text, L"%d K", (int)CommitChargeTotal); /* * Draw the font text onto the graph */ @@ -345,7 +345,7 @@ void Graph_DrawMemUsageGraph(HDC hDC, HWND hWnd) InflateRect(&rcText, -2, -2); crPrevForeground = SetTextColor(hDC, RGB(0, 255, 0)); hOldFont = SelectObject(hDC, GetStockObject(DEFAULT_GUI_FONT)); - DrawText(hDC, Text, -1, &rcText, DT_BOTTOM | DT_CENTER | DT_NOPREFIX | DT_SINGLELINE); + DrawTextW(hDC, Text, -1, &rcText, DT_BOTTOM | DT_CENTER | DT_NOPREFIX | DT_SINGLELINE); SelectObject(hDC, hOldFont); SetTextColor(hDC, crPrevForeground); diff --git a/reactos/base/applications/taskmgr/graphctl.c b/reactos/base/applications/taskmgr/graphctl.c index 941494af1c1..b828a8dcc4e 100644 --- a/reactos/base/applications/taskmgr/graphctl.c +++ b/reactos/base/applications/taskmgr/graphctl.c @@ -644,5 +644,5 @@ GraphCtrl_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) /* * We pass on all non-handled messages */ - return CallWindowProc((WNDPROC)OldGraphCtrlWndProc, hWnd, message, wParam, lParam); + return CallWindowProcW((WNDPROC)OldGraphCtrlWndProc, hWnd, message, wParam, lParam); } diff --git a/reactos/base/applications/taskmgr/optnmenu.c b/reactos/base/applications/taskmgr/optnmenu.c index 880bf7e61c9..c82d4b8b567 100644 --- a/reactos/base/applications/taskmgr/optnmenu.c +++ b/reactos/base/applications/taskmgr/optnmenu.c @@ -40,7 +40,7 @@ void TaskManager_OnOptionsAlwaysOnTop(void) * Check or uncheck the always on top menu item * and update main window. */ - if ((GetWindowLong(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0) + if ((GetWindowLongW(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0) { CheckMenuItem(hOptionsMenu, ID_OPTIONS_ALWAYSONTOP, MF_BYCOMMAND|MF_UNCHECKED); TaskManagerSettings.AlwaysOnTop = FALSE; diff --git a/reactos/base/applications/taskmgr/perfdata.c b/reactos/base/applications/taskmgr/perfdata.c index e9b3387a2e1..dc1c87a20ca 100644 --- a/reactos/base/applications/taskmgr/perfdata.c +++ b/reactos/base/applications/taskmgr/perfdata.c @@ -76,14 +76,14 @@ void PerfDataUninitialize(void) } } -static void SidToUserName(PSID Sid, LPTSTR szBuffer, DWORD BufferSize) +static void SidToUserName(PSID Sid, LPWSTR szBuffer, DWORD BufferSize) { static WCHAR szDomainNameUnused[255]; DWORD DomainNameLen = sizeof(szDomainNameUnused) / sizeof(szDomainNameUnused[0]); SID_NAME_USE Use; if (Sid != NULL) - LookupAccountSid(NULL, Sid, szBuffer, &BufferSize, szDomainNameUnused, &DomainNameLen, &Use); + LookupAccountSidW(NULL, Sid, szBuffer, &BufferSize, szDomainNameUnused, &DomainNameLen, &Use); } void PerfDataRefresh(void) @@ -260,7 +260,7 @@ void PerfDataRefresh(void) if (pSPI->ImageName.Buffer) wcscpy(pPerfData[Idx].ImageName, pSPI->ImageName.Buffer); else - LoadString(hInst, IDS_IDLE_PROCESS, pPerfData[Idx].ImageName, + LoadStringW(hInst, IDS_IDLE_PROCESS, pPerfData[Idx].ImageName, sizeof(pPerfData[Idx].ImageName) / sizeof(pPerfData[Idx].ImageName[0])); pPerfData[Idx].ProcessId = pSPI->UniqueProcessId; @@ -368,7 +368,7 @@ ULONG PerfDataGetProcessorSystemUsage(void) return (ULONG)dbKernelTime; } -BOOL PerfDataGetImageName(ULONG Index, LPTSTR lpImageName, int nMaxCount) +BOOL PerfDataGetImageName(ULONG Index, LPWSTR lpImageName, int nMaxCount) { BOOL bSuccessful; @@ -420,7 +420,7 @@ ULONG PerfDataGetProcessId(ULONG Index) return ProcessId; } -BOOL PerfDataGetUserName(ULONG Index, LPTSTR lpUserName, int nMaxCount) +BOOL PerfDataGetUserName(ULONG Index, LPWSTR lpUserName, int nMaxCount) { BOOL bSuccessful; diff --git a/reactos/base/applications/taskmgr/perfpage.c b/reactos/base/applications/taskmgr/perfpage.c index e0460b4cac4..e011c6e3364 100644 --- a/reactos/base/applications/taskmgr/perfpage.c +++ b/reactos/base/applications/taskmgr/perfpage.c @@ -198,10 +198,10 @@ PerformancePageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) /* * Subclass graph buttons */ - OldGraphWndProc = (WNDPROC)(LONG_PTR) SetWindowLongPtr(hPerformancePageCpuUsageGraph, GWL_WNDPROC, (LONG_PTR)Graph_WndProc); - SetWindowLongPtr(hPerformancePageMemUsageGraph, GWL_WNDPROC, (LONG_PTR)Graph_WndProc); - OldGraphCtrlWndProc = (WNDPROC)(LONG_PTR) SetWindowLongPtr(hPerformancePageMemUsageHistoryGraph, GWL_WNDPROC, (LONG_PTR)GraphCtrl_WndProc); - SetWindowLongPtr(hPerformancePageCpuUsageHistoryGraph, GWL_WNDPROC, (LONG_PTR)GraphCtrl_WndProc); + OldGraphWndProc = (WNDPROC)(LONG_PTR) SetWindowLongPtrW(hPerformancePageCpuUsageGraph, GWL_WNDPROC, (LONG_PTR)Graph_WndProc); + SetWindowLongPtrW(hPerformancePageMemUsageGraph, GWL_WNDPROC, (LONG_PTR)Graph_WndProc); + OldGraphCtrlWndProc = (WNDPROC)(LONG_PTR) SetWindowLongPtrW(hPerformancePageMemUsageHistoryGraph, GWL_WNDPROC, (LONG_PTR)GraphCtrl_WndProc); + SetWindowLongPtrW(hPerformancePageCpuUsageHistoryGraph, GWL_WNDPROC, (LONG_PTR)GraphCtrl_WndProc); return TRUE; case WM_COMMAND: @@ -333,13 +333,13 @@ DWORD WINAPI PerformancePageRefreshThread(void *lpParameter) WCHAR szMemUsage[256]; /* Create the event */ - hPerformancePageEvent = CreateEvent(NULL, TRUE, TRUE, NULL); + hPerformancePageEvent = CreateEventW(NULL, TRUE, TRUE, NULL); /* If we couldn't create the event then exit the thread */ if (!hPerformancePageEvent) return 0; - LoadString(hInst, IDS_STATUS_MEMUSAGE, szMemUsage, 256); + LoadStringW(hInst, IDS_STATUS_MEMUSAGE, szMemUsage, 256); while (1) { @@ -368,13 +368,13 @@ DWORD WINAPI PerformancePageRefreshThread(void *lpParameter) CommitChargeLimit = PerfDataGetCommitChargeLimitK(); CommitChargePeak = PerfDataGetCommitChargePeakK(); _ultow(CommitChargeTotal, Text, 10); - SetWindowText(hPerformancePageCommitChargeTotalEdit, Text); + SetWindowTextW(hPerformancePageCommitChargeTotalEdit, Text); _ultow(CommitChargeLimit, Text, 10); - SetWindowText(hPerformancePageCommitChargeLimitEdit, Text); + SetWindowTextW(hPerformancePageCommitChargeLimitEdit, Text); _ultow(CommitChargePeak, Text, 10); - SetWindowText(hPerformancePageCommitChargePeakEdit, Text); - wsprintf(Text, szMemUsage, CommitChargeTotal, CommitChargeLimit); - SendMessage(hStatusWnd, SB_SETTEXT, 2, (LPARAM)Text); + SetWindowTextW(hPerformancePageCommitChargePeakEdit, Text); + wsprintfW(Text, szMemUsage, CommitChargeTotal, CommitChargeLimit); + SendMessageW(hStatusWnd, SB_SETTEXT, 2, (LPARAM)Text); /* * Update the kernel memory info @@ -383,11 +383,11 @@ DWORD WINAPI PerformancePageRefreshThread(void *lpParameter) KernelMemoryPaged = PerfDataGetKernelMemoryPagedK(); KernelMemoryNonPaged = PerfDataGetKernelMemoryNonPagedK(); _ultow(KernelMemoryTotal, Text, 10); - SetWindowText(hPerformancePageKernelMemoryTotalEdit, Text); + SetWindowTextW(hPerformancePageKernelMemoryTotalEdit, Text); _ultow(KernelMemoryPaged, Text, 10); - SetWindowText(hPerformancePageKernelMemoryPagedEdit, Text); + SetWindowTextW(hPerformancePageKernelMemoryPagedEdit, Text); _ultow(KernelMemoryNonPaged, Text, 10); - SetWindowText(hPerformancePageKernelMemoryNonPagedEdit, Text); + SetWindowTextW(hPerformancePageKernelMemoryNonPagedEdit, Text); /* * Update the physical memory info @@ -396,11 +396,11 @@ DWORD WINAPI PerformancePageRefreshThread(void *lpParameter) PhysicalMemoryAvailable = PerfDataGetPhysicalMemoryAvailableK(); PhysicalMemorySystemCache = PerfDataGetPhysicalMemorySystemCacheK(); _ultow(PhysicalMemoryTotal, Text, 10); - SetWindowText(hPerformancePagePhysicalMemoryTotalEdit, Text); + SetWindowTextW(hPerformancePagePhysicalMemoryTotalEdit, Text); _ultow(PhysicalMemoryAvailable, Text, 10); - SetWindowText(hPerformancePagePhysicalMemoryAvailableEdit, Text); + SetWindowTextW(hPerformancePagePhysicalMemoryAvailableEdit, Text); _ultow(PhysicalMemorySystemCache, Text, 10); - SetWindowText(hPerformancePagePhysicalMemorySystemCacheEdit, Text); + SetWindowTextW(hPerformancePagePhysicalMemorySystemCacheEdit, Text); /* * Update the totals info @@ -409,11 +409,11 @@ DWORD WINAPI PerformancePageRefreshThread(void *lpParameter) TotalThreads = PerfDataGetTotalThreadCount(); TotalProcesses = PerfDataGetProcessCount(); _ultow(TotalHandles, Text, 10); - SetWindowText(hPerformancePageTotalsHandleCountEdit, Text); + SetWindowTextW(hPerformancePageTotalsHandleCountEdit, Text); _ultow(TotalThreads, Text, 10); - SetWindowText(hPerformancePageTotalsThreadCountEdit, Text); + SetWindowTextW(hPerformancePageTotalsThreadCountEdit, Text); _ultow(TotalProcesses, Text, 10); - SetWindowText(hPerformancePageTotalsProcessCountEdit, Text); + SetWindowTextW(hPerformancePageTotalsProcessCountEdit, Text); /* * Redraw the graphs diff --git a/reactos/base/applications/taskmgr/priority.c b/reactos/base/applications/taskmgr/priority.c index 4c9d7f69b59..8239b59129e 100644 --- a/reactos/base/applications/taskmgr/priority.c +++ b/reactos/base/applications/taskmgr/priority.c @@ -53,9 +53,9 @@ void ProcessPage_OnSetPriorityRealTime(void) if ((ListView_GetSelectedCount(hProcessPageListCtrl) != 1) || (dwProcessId == 0)) return; - LoadString(hInst, IDS_MSG_WARNINGCHANGEPRIORITY, szTemp, 256); - LoadString(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); - if (MessageBox(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) + LoadStringW(hInst, IDS_MSG_WARNINGCHANGEPRIORITY, szTemp, 256); + LoadStringW(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); + if (MessageBoxW(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) return; hProcess = OpenProcess(PROCESS_SET_INFORMATION, FALSE, dwProcessId); @@ -63,16 +63,16 @@ void ProcessPage_OnSetPriorityRealTime(void) if (!hProcess) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); return; } if (!SetPriorityClass(hProcess, REALTIME_PRIORITY_CLASS)) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); } CloseHandle(hProcess); @@ -105,9 +105,9 @@ void ProcessPage_OnSetPriorityHigh(void) if ((ListView_GetSelectedCount(hProcessPageListCtrl) != 1) || (dwProcessId == 0)) return; - LoadString(hInst, IDS_MSG_WARNINGCHANGEPRIORITY, szTemp, 256); - LoadString(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); - if (MessageBox(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) + LoadStringW(hInst, IDS_MSG_WARNINGCHANGEPRIORITY, szTemp, 256); + LoadStringW(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); + if (MessageBoxW(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) return; hProcess = OpenProcess(PROCESS_SET_INFORMATION, FALSE, dwProcessId); @@ -115,16 +115,16 @@ void ProcessPage_OnSetPriorityHigh(void) if (!hProcess) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); return; } if (!SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS)) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); } CloseHandle(hProcess); @@ -157,9 +157,9 @@ void ProcessPage_OnSetPriorityAboveNormal(void) if ((ListView_GetSelectedCount(hProcessPageListCtrl) != 1) || (dwProcessId == 0)) return; - LoadString(hInst, IDS_MSG_WARNINGCHANGEPRIORITY, szTemp, 256); - LoadString(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); - if (MessageBox(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) + LoadStringW(hInst, IDS_MSG_WARNINGCHANGEPRIORITY, szTemp, 256); + LoadStringW(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); + if (MessageBoxW(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) return; hProcess = OpenProcess(PROCESS_SET_INFORMATION, FALSE, dwProcessId); @@ -167,16 +167,16 @@ void ProcessPage_OnSetPriorityAboveNormal(void) if (!hProcess) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); return; } if (!SetPriorityClass(hProcess, ABOVE_NORMAL_PRIORITY_CLASS)) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); } CloseHandle(hProcess); @@ -209,9 +209,9 @@ void ProcessPage_OnSetPriorityNormal(void) if ((ListView_GetSelectedCount(hProcessPageListCtrl) != 1) || (dwProcessId == 0)) return; - LoadString(hInst, IDS_MSG_WARNINGCHANGEPRIORITY, szTemp, 256); - LoadString(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); - if (MessageBox(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) + LoadStringW(hInst, IDS_MSG_WARNINGCHANGEPRIORITY, szTemp, 256); + LoadStringW(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); + if (MessageBoxW(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) return; hProcess = OpenProcess(PROCESS_SET_INFORMATION, FALSE, dwProcessId); @@ -219,16 +219,16 @@ void ProcessPage_OnSetPriorityNormal(void) if (!hProcess) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); return; } if (!SetPriorityClass(hProcess, NORMAL_PRIORITY_CLASS)) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); } CloseHandle(hProcess); @@ -261,9 +261,9 @@ void ProcessPage_OnSetPriorityBelowNormal(void) if ((ListView_GetSelectedCount(hProcessPageListCtrl) != 1) || (dwProcessId == 0)) return; - LoadString(hInst, IDS_MSG_WARNINGCHANGEPRIORITY, szTemp, 256); - LoadString(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); - if (MessageBox(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) + LoadStringW(hInst, IDS_MSG_WARNINGCHANGEPRIORITY, szTemp, 256); + LoadStringW(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); + if (MessageBoxW(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) return; hProcess = OpenProcess(PROCESS_SET_INFORMATION, FALSE, dwProcessId); @@ -271,16 +271,16 @@ void ProcessPage_OnSetPriorityBelowNormal(void) if (!hProcess) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); return; } if (!SetPriorityClass(hProcess, BELOW_NORMAL_PRIORITY_CLASS)) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); } CloseHandle(hProcess); @@ -313,9 +313,9 @@ void ProcessPage_OnSetPriorityLow(void) if ((ListView_GetSelectedCount(hProcessPageListCtrl) != 1) || (dwProcessId == 0)) return; - LoadString(hInst, IDS_MSG_WARNINGCHANGEPRIORITY, szTemp, 256); - LoadString(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); - if (MessageBox(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) + LoadStringW(hInst, IDS_MSG_WARNINGCHANGEPRIORITY, szTemp, 256); + LoadStringW(hInst, IDS_MSG_TASKMGRWARNING, szTempA, 256); + if (MessageBoxW(hMainWnd, szTemp, szTempA, MB_YESNO|MB_ICONWARNING) != IDYES) return; hProcess = OpenProcess(PROCESS_SET_INFORMATION, FALSE, dwProcessId); @@ -323,16 +323,16 @@ void ProcessPage_OnSetPriorityLow(void) if (!hProcess) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); return; } if (!SetPriorityClass(hProcess, IDLE_PRIORITY_CLASS)) { GetLastErrorText(strErrorText, 260); - LoadString(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); - MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); + LoadStringW(hInst, IDS_MSG_UNABLECHANGEPRIORITY, szTemp, 256); + MessageBoxW(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP); } CloseHandle(hProcess); diff --git a/reactos/base/applications/taskmgr/proclist.c b/reactos/base/applications/taskmgr/proclist.c index 4789ba69688..6ec9214897a 100644 --- a/reactos/base/applications/taskmgr/proclist.c +++ b/reactos/base/applications/taskmgr/proclist.c @@ -62,7 +62,7 @@ ProcessListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) /* * Get the background brush */ - hbrBackground = (HBRUSH)(LONG_PTR) GetClassLongPtr(hWnd, GCL_HBRBACKGROUND); + hbrBackground = (HBRUSH)(LONG_PTR) GetClassLongPtrW(hWnd, GCL_HBRBACKGROUND); /* * Calculate the clip rect by getting the RECT @@ -73,12 +73,12 @@ ProcessListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) * use icons in this list control. */ rcClip.left = LVIR_BOUNDS; - SendMessage(hWnd, LVM_GETITEMRECT, 0, (LPARAM)&rcClip); + SendMessageW(hWnd, LVM_GETITEMRECT, 0, (LPARAM)&rcClip); rcClip.left = LVIR_BOUNDS; - SendMessage(hWnd, LVM_GETITEMRECT, ListView_GetItemCount(hWnd) - 1, (LPARAM)&rcItem); + SendMessageW(hWnd, LVM_GETITEMRECT, ListView_GetItemCount(hWnd) - 1, (LPARAM)&rcItem); rcClip.bottom = rcItem.bottom; rcClip.left = LVIR_ICON; - SendMessage(hWnd, LVM_GETITEMRECT, 0, (LPARAM)&rcItem); + SendMessageW(hWnd, LVM_GETITEMRECT, 0, (LPARAM)&rcItem); rcClip.left = rcItem.right; /* @@ -109,5 +109,5 @@ ProcessListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) /* * We pass on all messages except WM_ERASEBKGND */ - return CallWindowProc(OldProcessListWndProc, hWnd, message, wParam, lParam); + return CallWindowProcW(OldProcessListWndProc, hWnd, message, wParam, lParam); } diff --git a/reactos/base/applications/taskmgr/procpage.c b/reactos/base/applications/taskmgr/procpage.c index 520da12473d..8d91de0915d 100644 --- a/reactos/base/applications/taskmgr/procpage.c +++ b/reactos/base/applications/taskmgr/procpage.c @@ -35,7 +35,7 @@ static int nProcessPageHeight; static HANDLE hProcessPageEvent = NULL; /* When this event becomes signaled then we refresh the process list */ void ProcessPageOnNotify(WPARAM wParam, LPARAM lParam); -void CommaSeparateNumberString(LPTSTR strNumber, int nMaxCount); +void CommaSeparateNumberString(LPWSTR strNumber, int nMaxCount); void ProcessPageShowContextMenu(DWORD dwProcessId); DWORD WINAPI ProcessPageRefreshThread(void *lpParameter); @@ -71,8 +71,8 @@ ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) /* * Set the font, title, and extended window styles for the list control */ - SendMessage(hProcessPageListCtrl, WM_SETFONT, SendMessage(hProcessPage, WM_GETFONT, 0, 0), TRUE); - SetWindowText(hProcessPageListCtrl, L"Processes"); + SendMessageW(hProcessPageListCtrl, WM_SETFONT, SendMessageW(hProcessPage, WM_GETFONT, 0, 0), TRUE); + SetWindowTextW(hProcessPageListCtrl, L"Processes"); (void)ListView_SetExtendedListViewStyle(hProcessPageListCtrl, ListView_GetExtendedListViewStyle(hProcessPageListCtrl) | LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP); AddColumns(); @@ -80,7 +80,7 @@ ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) /* * Subclass the process list control so we can intercept WM_ERASEBKGND */ - OldProcessListWndProc = (WNDPROC)(LONG_PTR) SetWindowLongPtr(hProcessPageListCtrl, GWL_WNDPROC, (LONG_PTR)ProcessListWndProc); + OldProcessListWndProc = (WNDPROC)(LONG_PTR) SetWindowLongPtrW(hProcessPageListCtrl, GWL_WNDPROC, (LONG_PTR)ProcessListWndProc); /* Start our refresh thread */ hRefreshThread = CreateThread(NULL, 0, ProcessPageRefreshThread, NULL, 0, NULL); @@ -189,13 +189,13 @@ void ProcessPageOnNotify(WPARAM wParam, LPARAM lParam) if (ColumnDataHints[ColumnIndex] == COLUMN_IMAGENAME) PerfDataGetImageName(Index, pnmdi->item.pszText, pnmdi->item.cchTextMax); if (ColumnDataHints[ColumnIndex] == COLUMN_PID) - wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetProcessId(Index)); + wsprintfW(pnmdi->item.pszText, L"%d", PerfDataGetProcessId(Index)); if (ColumnDataHints[ColumnIndex] == COLUMN_USERNAME) PerfDataGetUserName(Index, pnmdi->item.pszText, pnmdi->item.cchTextMax); if (ColumnDataHints[ColumnIndex] == COLUMN_SESSIONID) - wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetSessionId(Index)); + wsprintfW(pnmdi->item.pszText, L"%d", PerfDataGetSessionId(Index)); if (ColumnDataHints[ColumnIndex] == COLUMN_CPUUSAGE) - wsprintf(pnmdi->item.pszText, L"%02d", PerfDataGetCPUUsage(Index)); + wsprintfW(pnmdi->item.pszText, L"%02d", PerfDataGetCPUUsage(Index)); if (ColumnDataHints[ColumnIndex] == COLUMN_CPUTIME) { DWORD dwHours; @@ -212,115 +212,115 @@ void ProcessPageOnNotify(WPARAM wParam, LPARAM lParam) dwMinutes = (DWORD)((time.QuadPart % 36000000000LL) / 600000000LL); dwSeconds = (DWORD)(((time.QuadPart % 36000000000LL) % 600000000LL) / 10000000LL); #endif - wsprintf(pnmdi->item.pszText, L"%d:%02d:%02d", dwHours, dwMinutes, dwSeconds); + wsprintfW(pnmdi->item.pszText, L"%d:%02d:%02d", dwHours, dwMinutes, dwSeconds); } if (ColumnDataHints[ColumnIndex] == COLUMN_MEMORYUSAGE) { - wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetWorkingSetSizeBytes(Index) / 1024); + wsprintfW(pnmdi->item.pszText, L"%d", PerfDataGetWorkingSetSizeBytes(Index) / 1024); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); wcscat(pnmdi->item.pszText, L" K"); } if (ColumnDataHints[ColumnIndex] == COLUMN_PEAKMEMORYUSAGE) { - wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetPeakWorkingSetSizeBytes(Index) / 1024); + wsprintfW(pnmdi->item.pszText, L"%d", PerfDataGetPeakWorkingSetSizeBytes(Index) / 1024); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); wcscat(pnmdi->item.pszText, L" K"); } if (ColumnDataHints[ColumnIndex] == COLUMN_MEMORYUSAGEDELTA) { - wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetWorkingSetSizeDelta(Index) / 1024); + wsprintfW(pnmdi->item.pszText, L"%d", PerfDataGetWorkingSetSizeDelta(Index) / 1024); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); wcscat(pnmdi->item.pszText, L" K"); } if (ColumnDataHints[ColumnIndex] == COLUMN_PAGEFAULTS) { - wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetPageFaultCount(Index)); + wsprintfW(pnmdi->item.pszText, L"%d", PerfDataGetPageFaultCount(Index)); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); } if (ColumnDataHints[ColumnIndex] == COLUMN_PAGEFAULTSDELTA) { - wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetPageFaultCountDelta(Index)); + wsprintfW(pnmdi->item.pszText, L"%d", PerfDataGetPageFaultCountDelta(Index)); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); } if (ColumnDataHints[ColumnIndex] == COLUMN_VIRTUALMEMORYSIZE) { - wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetVirtualMemorySizeBytes(Index) / 1024); + wsprintfW(pnmdi->item.pszText, L"%d", PerfDataGetVirtualMemorySizeBytes(Index) / 1024); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); wcscat(pnmdi->item.pszText, L" K"); } if (ColumnDataHints[ColumnIndex] == COLUMN_PAGEDPOOL) { - wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetPagedPoolUsagePages(Index) / 1024); + wsprintfW(pnmdi->item.pszText, L"%d", PerfDataGetPagedPoolUsagePages(Index) / 1024); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); wcscat(pnmdi->item.pszText, L" K"); } if (ColumnDataHints[ColumnIndex] == COLUMN_NONPAGEDPOOL) { - wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetNonPagedPoolUsagePages(Index) / 1024); + wsprintfW(pnmdi->item.pszText, L"%d", PerfDataGetNonPagedPoolUsagePages(Index) / 1024); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); wcscat(pnmdi->item.pszText, L" K"); } if (ColumnDataHints[ColumnIndex] == COLUMN_BASEPRIORITY) - wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetBasePriority(Index)); + wsprintfW(pnmdi->item.pszText, L"%d", PerfDataGetBasePriority(Index)); if (ColumnDataHints[ColumnIndex] == COLUMN_HANDLECOUNT) { - wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetHandleCount(Index)); + wsprintfW(pnmdi->item.pszText, L"%d", PerfDataGetHandleCount(Index)); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); } if (ColumnDataHints[ColumnIndex] == COLUMN_THREADCOUNT) { - wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetThreadCount(Index)); + wsprintfW(pnmdi->item.pszText, L"%d", PerfDataGetThreadCount(Index)); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); } if (ColumnDataHints[ColumnIndex] == COLUMN_USEROBJECTS) { - wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetUSERObjectCount(Index)); + wsprintfW(pnmdi->item.pszText, L"%d", PerfDataGetUSERObjectCount(Index)); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); } if (ColumnDataHints[ColumnIndex] == COLUMN_GDIOBJECTS) { - wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetGDIObjectCount(Index)); + wsprintfW(pnmdi->item.pszText, L"%d", PerfDataGetGDIObjectCount(Index)); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); } if (ColumnDataHints[ColumnIndex] == COLUMN_IOREADS) { PerfDataGetIOCounters(Index, &iocounters); - /* wsprintf(pnmdi->item.pszText, L"%d", iocounters.ReadOperationCount); */ + /* wsprintfW(pnmdi->item.pszText, L"%d", iocounters.ReadOperationCount); */ _ui64tow(iocounters.ReadOperationCount, pnmdi->item.pszText, 10); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); } if (ColumnDataHints[ColumnIndex] == COLUMN_IOWRITES) { PerfDataGetIOCounters(Index, &iocounters); - /* wsprintf(pnmdi->item.pszText, L"%d", iocounters.WriteOperationCount); */ + /* wsprintfW(pnmdi->item.pszText, L"%d", iocounters.WriteOperationCount); */ _ui64tow(iocounters.WriteOperationCount, pnmdi->item.pszText, 10); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); } if (ColumnDataHints[ColumnIndex] == COLUMN_IOOTHER) { PerfDataGetIOCounters(Index, &iocounters); - /* wsprintf(pnmdi->item.pszText, L"%d", iocounters.OtherOperationCount); */ + /* wsprintfW(pnmdi->item.pszText, L"%d", iocounters.OtherOperationCount); */ _ui64tow(iocounters.OtherOperationCount, pnmdi->item.pszText, 10); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); } if (ColumnDataHints[ColumnIndex] == COLUMN_IOREADBYTES) { PerfDataGetIOCounters(Index, &iocounters); - /* wsprintf(pnmdi->item.pszText, L"%d", iocounters.ReadTransferCount); */ + /* wsprintfW(pnmdi->item.pszText, L"%d", iocounters.ReadTransferCount); */ _ui64tow(iocounters.ReadTransferCount, pnmdi->item.pszText, 10); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); } if (ColumnDataHints[ColumnIndex] == COLUMN_IOWRITEBYTES) { PerfDataGetIOCounters(Index, &iocounters); - /* wsprintf(pnmdi->item.pszText, L"%d", iocounters.WriteTransferCount); */ + /* wsprintfW(pnmdi->item.pszText, L"%d", iocounters.WriteTransferCount); */ _ui64tow(iocounters.WriteTransferCount, pnmdi->item.pszText, 10); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); } if (ColumnDataHints[ColumnIndex] == COLUMN_IOOTHERBYTES) { PerfDataGetIOCounters(Index, &iocounters); - /* wsprintf(pnmdi->item.pszText, L"%d", iocounters.OtherTransferCount); */ + /* wsprintfW(pnmdi->item.pszText, L"%d", iocounters.OtherTransferCount); */ _ui64tow(iocounters.OtherTransferCount, pnmdi->item.pszText, 10); CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax); } @@ -385,7 +385,7 @@ void ProcessPageOnNotify(WPARAM wParam, LPARAM lParam) } -void CommaSeparateNumberString(LPTSTR strNumber, int nMaxCount) +void CommaSeparateNumberString(LPWSTR strNumber, int nMaxCount) { WCHAR temp[260]; UINT i, j, k; @@ -420,7 +420,7 @@ void ProcessPageShowContextMenu(DWORD dwProcessId) GetCursorPos(&pt); GetSystemInfo(&si); - hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_PROCESS_PAGE_CONTEXT)); + hMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_PROCESS_PAGE_CONTEXT)); hSubMenu = GetSubMenu(hMenu, 0); hPriorityMenu = GetSubMenu(hSubMenu, 4); @@ -455,10 +455,10 @@ void ProcessPageShowContextMenu(DWORD dwProcessId) break; } - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug", 0, KEY_READ, &hKey) == ERROR_SUCCESS) + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug", 0, KEY_READ, &hKey) == ERROR_SUCCESS) { dwDebuggerSize = 260; - if (RegQueryValueEx(hKey, L"Debugger", NULL, NULL, (LPBYTE)strDebugger, &dwDebuggerSize) == ERROR_SUCCESS) + if (RegQueryValueExW(hKey, L"Debugger", NULL, NULL, (LPBYTE)strDebugger, &dwDebuggerSize) == ERROR_SUCCESS) { for (Idx=0; Idx