Commit e5072fa6 authored by Andrew Nguyen's avatar Andrew Nguyen Committed by Alexandre Julliard

taskmgr: Remove all TCHAR macro usage in tab page code.

parent a12ed578
...@@ -146,7 +146,7 @@ static DWORD WINAPI PerformancePageRefreshThread(void *lpParameter) ...@@ -146,7 +146,7 @@ static DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
LoadStringW(hInst, IDS_STATUS_BAR_MEMORY_USAGE, wszMemUsage, sizeof(wszMemUsage)/sizeof(WCHAR)); 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 = CreateEventW(NULL, TRUE, TRUE, NULL);
/* If we couldn't create the event then exit the thread */ /* If we couldn't create the event then exit the thread */
if (!hPerformancePageEvent) if (!hPerformancePageEvent)
...@@ -344,11 +344,11 @@ PerformancePageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) ...@@ -344,11 +344,11 @@ PerformancePageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
/* /*
* Subclass graph buttons * Subclass graph buttons
*/ */
OldGraphWndProc = (WNDPROC)SetWindowLongPtr(hPerformancePageCpuUsageGraph, GWLP_WNDPROC, (LONG_PTR)Graph_WndProc); OldGraphWndProc = (WNDPROC)SetWindowLongPtrW(hPerformancePageCpuUsageGraph, GWLP_WNDPROC, (LONG_PTR)Graph_WndProc);
SetWindowLongPtr(hPerformancePageMemUsageGraph, GWLP_WNDPROC, (LONG_PTR)Graph_WndProc); SetWindowLongPtrW(hPerformancePageMemUsageGraph, GWLP_WNDPROC, (LONG_PTR)Graph_WndProc);
OldGraphCtrlWndProc = (WNDPROC)SetWindowLongPtr(hPerformancePageMemUsageHistoryGraph, GWLP_WNDPROC, (LONG_PTR)GraphCtrl_WndProc); OldGraphCtrlWndProc = (WNDPROC)SetWindowLongPtrW(hPerformancePageMemUsageHistoryGraph, GWLP_WNDPROC, (LONG_PTR)GraphCtrl_WndProc);
SetWindowLongPtr(hPerformancePageCpuUsageHistoryGraph, GWLP_WNDPROC, (LONG_PTR)GraphCtrl_WndProc); SetWindowLongPtrW(hPerformancePageCpuUsageHistoryGraph, GWLP_WNDPROC, (LONG_PTR)GraphCtrl_WndProc);
return TRUE; return TRUE;
case WM_COMMAND: case WM_COMMAND:
break; break;
......
...@@ -89,7 +89,7 @@ static void ProcessPageShowContextMenu(DWORD dwProcessId) ...@@ -89,7 +89,7 @@ static void ProcessPageShowContextMenu(DWORD dwProcessId)
GetCursorPos(&pt); GetCursorPos(&pt);
GetSystemInfo(&si); GetSystemInfo(&si);
hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_PROCESS_PAGE_CONTEXT)); hMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_PROCESS_PAGE_CONTEXT));
hSubMenu = GetSubMenu(hMenu, 0); hSubMenu = GetSubMenu(hMenu, 0);
hPriorityMenu = GetSubMenu(hSubMenu, 4); hPriorityMenu = GetSubMenu(hSubMenu, 4);
...@@ -152,8 +152,8 @@ static void ProcessPageOnNotify(LPARAM lParam) ...@@ -152,8 +152,8 @@ static void ProcessPageOnNotify(LPARAM lParam)
{ {
LPNMHDR pnmh; LPNMHDR pnmh;
NMLVDISPINFOW* pnmdi; NMLVDISPINFOW* pnmdi;
LVITEM lvitem; LVITEMW lvitem;
ULONG Index; ULONG Index, Count;
ULONG ColumnIndex; ULONG ColumnIndex;
IO_COUNTERS iocounters; IO_COUNTERS iocounters;
TIME time; TIME time;
...@@ -321,21 +321,21 @@ static void ProcessPageOnNotify(LPARAM lParam) ...@@ -321,21 +321,21 @@ static void ProcessPageOnNotify(LPARAM lParam)
break; break;
case NM_RCLICK: case NM_RCLICK:
Count = SendMessageW(hProcessPageListCtrl, LVM_GETITEMCOUNT, 0, 0);
for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++) for (Index=0; Index<Count; Index++)
{ {
lvitem.mask = LVIF_STATE; lvitem.mask = LVIF_STATE;
lvitem.stateMask = LVIS_SELECTED; lvitem.stateMask = LVIS_SELECTED;
lvitem.iItem = Index; lvitem.iItem = Index;
lvitem.iSubItem = 0; lvitem.iSubItem = 0;
SendMessage(hProcessPageListCtrl, LVM_GETITEM, 0, (LPARAM) &lvitem); SendMessageW(hProcessPageListCtrl, LVM_GETITEMW, 0, (LPARAM) &lvitem);
if (lvitem.state & LVIS_SELECTED) if (lvitem.state & LVIS_SELECTED)
break; break;
} }
if ((ListView_GetSelectedCount(hProcessPageListCtrl) == 1) && if ((SendMessageW(hProcessPageListCtrl, LVM_GETSELECTEDCOUNT, 0, 0) == 1) &&
(PerfDataGetProcessId(Index) != 0)) (PerfDataGetProcessId(Index) != 0))
{ {
ProcessPageShowContextMenu(PerfDataGetProcessId(Index)); ProcessPageShowContextMenu(PerfDataGetProcessId(Index));
...@@ -396,7 +396,7 @@ static DWORD WINAPI ProcessPageRefreshThread(void *lpParameter) ...@@ -396,7 +396,7 @@ static DWORD WINAPI ProcessPageRefreshThread(void *lpParameter)
LoadStringW(hInst, IDS_STATUS_BAR_PROCESSES, wszProcesses, sizeof(wszProcesses)/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 = CreateEventW(NULL, TRUE, TRUE, NULL);
/* If we couldn't create the event then exit the thread */ /* If we couldn't create the event then exit the thread */
if (!hProcessPageEvent) if (!hProcessPageEvent)
...@@ -419,8 +419,8 @@ static DWORD WINAPI ProcessPageRefreshThread(void *lpParameter) ...@@ -419,8 +419,8 @@ static DWORD WINAPI ProcessPageRefreshThread(void *lpParameter)
/* Reset our event */ /* Reset our event */
ResetEvent(hProcessPageEvent); ResetEvent(hProcessPageEvent);
if ((ULONG)SendMessage(hProcessPageListCtrl, LVM_GETITEMCOUNT, 0, 0) != PerfDataGetProcessCount()) if (SendMessageW(hProcessPageListCtrl, LVM_GETITEMCOUNT, 0, 0) != PerfDataGetProcessCount())
SendMessage(hProcessPageListCtrl, LVM_SETITEMCOUNT, PerfDataGetProcessCount(), /*LVSICF_NOINVALIDATEALL|*/LVSICF_NOSCROLL); SendMessageW(hProcessPageListCtrl, LVM_SETITEMCOUNT, PerfDataGetProcessCount(), /*LVSICF_NOINVALIDATEALL|*/LVSICF_NOSCROLL);
if (IsWindowVisible(hProcessPage)) if (IsWindowVisible(hProcessPage))
InvalidateRect(hProcessPageListCtrl, NULL, FALSE); InvalidateRect(hProcessPageListCtrl, NULL, FALSE);
...@@ -447,6 +447,7 @@ ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) ...@@ -447,6 +447,7 @@ ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
int nXDifference; int nXDifference;
int nYDifference; int nYDifference;
int cx, cy; int cx, cy;
DWORD extended_styles;
switch (message) { switch (message) {
case WM_INITDIALOG: case WM_INITDIALOG:
...@@ -464,21 +465,22 @@ ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) ...@@ -464,21 +465,22 @@ ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
* Get handles to the controls * Get handles to the controls
*/ */
hProcessPageListCtrl = GetDlgItem(hDlg, IDC_PROCESSLIST); hProcessPageListCtrl = GetDlgItem(hDlg, IDC_PROCESSLIST);
hProcessPageHeaderCtrl = ListView_GetHeader(hProcessPageListCtrl); hProcessPageHeaderCtrl = (HWND)SendMessageW(hProcessPageListCtrl, LVM_GETHEADER, 0, 0);
hProcessPageEndProcessButton = GetDlgItem(hDlg, IDC_ENDPROCESS); hProcessPageEndProcessButton = GetDlgItem(hDlg, IDC_ENDPROCESS);
hProcessPageShowAllProcessesButton = GetDlgItem(hDlg, IDC_SHOWALLPROCESSES); hProcessPageShowAllProcessesButton = GetDlgItem(hDlg, IDC_SHOWALLPROCESSES);
/* /*
* Set the extended window styles for the list control * Set the extended window styles for the list control
*/ */
SendMessage(hProcessPageListCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, ListView_GetExtendedListViewStyle(hProcessPageListCtrl) | LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP); extended_styles = SendMessageW(hProcessPageListCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
SendMessageW(hProcessPageListCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, extended_styles | LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP);
AddColumns(); AddColumns();
/* /*
* Subclass the process list control so we can intercept WM_ERASEBKGND * Subclass the process list control so we can intercept WM_ERASEBKGND
*/ */
OldProcessListWndProc = (WNDPROC)SetWindowLongPtr(hProcessPageListCtrl, GWLP_WNDPROC, (LONG_PTR)ProcessListWndProc); OldProcessListWndProc = (WNDPROC)SetWindowLongPtrW(hProcessPageListCtrl, GWLP_WNDPROC, (LONG_PTR)ProcessListWndProc);
/* Start our refresh thread */ /* Start our refresh thread */
CreateThread(NULL, 0, ProcessPageRefreshThread, NULL, 0, NULL); CreateThread(NULL, 0, ProcessPageRefreshThread, NULL, 0, NULL);
......
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