mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 02:05:50 +00:00
- Add an #error, when UNICODE is not defined.
Task-Manager makes use of NDK API's, which forces the application to be compiled Unicode-only. - To make this obvious, change all TCHAR variables and functions to their Unicode counterparts and get rid of the "tchar.h" include. - Use a Unicode entry-point and 'unicode="yes"' instead of UNICODE and _UNICODE definitions in the rbuild file - Many indentation fixes svn path=/trunk/; revision=30031
This commit is contained in:
parent
16ca3d0bfa
commit
a14b40e394
20 changed files with 776 additions and 809 deletions
|
@ -33,7 +33,7 @@ INT_PTR CALLBACK
|
|||
AboutDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HWND hLicenseEditWnd;
|
||||
TCHAR strLicense[0x1000];
|
||||
WCHAR strLicense[0x1000];
|
||||
|
||||
switch (message)
|
||||
{
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
#include <precomp.h>
|
||||
|
||||
HANDLE hProcessAffinityHandle;
|
||||
TCHAR szTemp[256];
|
||||
TCHAR szTempA[256];
|
||||
WCHAR szTemp[256];
|
||||
WCHAR szTempA[256];
|
||||
|
||||
static const DWORD dwCpuTable[] = {
|
||||
IDC_CPU0, IDC_CPU1, IDC_CPU2, IDC_CPU3,
|
||||
|
@ -45,7 +45,7 @@ void ProcessPage_OnSetAffinity(void)
|
|||
LV_ITEM lvitem;
|
||||
ULONG Index;
|
||||
DWORD dwProcessId;
|
||||
TCHAR strErrorText[260];
|
||||
WCHAR strErrorText[260];
|
||||
|
||||
for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++) {
|
||||
memset(&lvitem, 0, sizeof(LV_ITEM));
|
||||
|
@ -61,8 +61,8 @@ void ProcessPage_OnSetAffinity(void)
|
|||
return;
|
||||
hProcessAffinityHandle = OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_SET_INFORMATION, FALSE, dwProcessId);
|
||||
if (!hProcessAffinityHandle) {
|
||||
GetLastErrorText(strErrorText, sizeof(strErrorText) / sizeof(TCHAR));
|
||||
LoadString(hInst, IDS_MSG_ACCESSPROCESSAFF, szTemp, sizeof(szTemp) / sizeof(TCHAR));
|
||||
GetLastErrorText(strErrorText, sizeof(strErrorText) / sizeof(WCHAR));
|
||||
LoadString(hInst, IDS_MSG_ACCESSPROCESSAFF, szTemp, sizeof(szTemp) / sizeof(WCHAR));
|
||||
MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP);
|
||||
return;
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ AffinityDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
{
|
||||
DWORD dwProcessAffinityMask = 0;
|
||||
DWORD dwSystemAffinityMask = 0;
|
||||
TCHAR strErrorText[260];
|
||||
WCHAR strErrorText[260];
|
||||
BYTE nCpu;
|
||||
|
||||
switch (message) {
|
||||
|
@ -89,9 +89,9 @@ AffinityDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
* the number of CPUs present in the system
|
||||
*/
|
||||
if (!GetProcessAffinityMask(hProcessAffinityHandle, &dwProcessAffinityMask, &dwSystemAffinityMask)) {
|
||||
GetLastErrorText(strErrorText, sizeof(strErrorText) / sizeof(TCHAR));
|
||||
GetLastErrorText(strErrorText, sizeof(strErrorText) / sizeof(WCHAR));
|
||||
EndDialog(hDlg, 0);
|
||||
LoadString(hInst, IDS_MSG_ACCESSPROCESSAFF, szTemp, sizeof(szTemp) / sizeof(TCHAR));
|
||||
LoadString(hInst, IDS_MSG_ACCESSPROCESSAFF, szTemp, sizeof(szTemp) / sizeof(WCHAR));
|
||||
MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP);
|
||||
}
|
||||
|
||||
|
@ -143,8 +143,8 @@ AffinityDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
* of it's cpu time.
|
||||
*/
|
||||
if (!dwProcessAffinityMask) {
|
||||
LoadString(hInst, IDS_MSG_PROCESSONEPRO, szTemp, sizeof(szTemp) / sizeof(TCHAR));
|
||||
LoadString(hInst, IDS_MSG_INVALIDOPTION, szTempA, sizeof(szTempA) / sizeof(TCHAR));
|
||||
LoadString(hInst, IDS_MSG_PROCESSONEPRO, szTemp, sizeof(szTemp) / sizeof(WCHAR));
|
||||
LoadString(hInst, IDS_MSG_INVALIDOPTION, szTempA, sizeof(szTempA) / sizeof(WCHAR));
|
||||
MessageBox(hDlg, szTemp, szTempA, MB_OK|MB_ICONSTOP);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -153,9 +153,9 @@ AffinityDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
* Try to set the process affinity
|
||||
*/
|
||||
if (!SetProcessAffinityMask(hProcessAffinityHandle, dwProcessAffinityMask)) {
|
||||
GetLastErrorText(strErrorText, sizeof(strErrorText) / sizeof(TCHAR));
|
||||
GetLastErrorText(strErrorText, sizeof(strErrorText) / sizeof(WCHAR));
|
||||
EndDialog(hDlg, LOWORD(wParam));
|
||||
LoadString(hInst, IDS_MSG_ACCESSPROCESSAFF, szTemp, sizeof(szTemp) / sizeof(TCHAR));
|
||||
LoadString(hInst, IDS_MSG_ACCESSPROCESSAFF, szTemp, sizeof(szTemp) / sizeof(WCHAR));
|
||||
MessageBox(hMainWnd, strErrorText, szTemp, MB_OK|MB_ICONSTOP);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
typedef struct
|
||||
{
|
||||
HWND hWnd;
|
||||
TCHAR szTitle[260];
|
||||
WCHAR szTitle[260];
|
||||
HICON hIcon;
|
||||
BOOL bHung;
|
||||
} APPLICATION_PAGE_LIST_ITEM, *LPAPPLICATION_PAGE_LIST_ITEM;
|
||||
|
@ -42,7 +42,7 @@ static HANDLE hApplicationPageEvent = NULL; /* When this event becomes signa
|
|||
static BOOL bSortAscending = TRUE;
|
||||
DWORD WINAPI ApplicationPageRefreshThread(void *lpParameter);
|
||||
BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam);
|
||||
void AddOrUpdateHwnd(HWND hWnd, TCHAR *szTitle, HICON hIcon, BOOL bHung);
|
||||
void AddOrUpdateHwnd(HWND hWnd, WCHAR *szTitle, HICON hIcon, BOOL bHung);
|
||||
void ApplicationPageUpdate(void);
|
||||
void ApplicationPageOnNotify(WPARAM wParam, LPARAM lParam);
|
||||
void ApplicationPageShowContextMenu1(void);
|
||||
|
@ -64,7 +64,7 @@ ApplicationPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
int nXDifference;
|
||||
int nYDifference;
|
||||
LV_COLUMN column;
|
||||
TCHAR szTemp[256];
|
||||
WCHAR szTemp[256];
|
||||
int cx, cy;
|
||||
HANDLE hRefreshThread = NULL;
|
||||
|
||||
|
@ -85,7 +85,7 @@ ApplicationPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
hApplicationPageSwitchToButton = GetDlgItem(hDlg, IDC_SWITCHTO);
|
||||
hApplicationPageNewTaskButton = GetDlgItem(hDlg, IDC_NEWTASK);
|
||||
|
||||
SetWindowText(hApplicationPageListCtrl, _T("Tasks"));
|
||||
SetWindowText(hApplicationPageListCtrl, L"Tasks");
|
||||
|
||||
/* Initialize the application page's controls */
|
||||
column.mask = LVCF_TEXT|LVCF_WIDTH;
|
||||
|
@ -252,7 +252,7 @@ DWORD WINAPI ApplicationPageRefreshThread(void *lpParameter)
|
|||
BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam)
|
||||
{
|
||||
HICON hIcon;
|
||||
TCHAR szText[260];
|
||||
WCHAR szText[260];
|
||||
BOOL bLargeIcon;
|
||||
BOOL bHung = FALSE;
|
||||
HICON* xhIcon = (HICON*)&hIcon;
|
||||
|
@ -270,7 +270,7 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam)
|
|||
GetWindowText(hWnd, szText, 260); /* Get the window text */
|
||||
|
||||
/* Check and see if this is a top-level app window */
|
||||
if ((_tcslen(szText) <= 0) ||
|
||||
if ((wcslen(szText) <= 0) ||
|
||||
!IsWindowVisible(hWnd) ||
|
||||
(GetParent(hWnd) != NULL) ||
|
||||
(GetWindow(hWnd, GW_OWNER) != NULL) ||
|
||||
|
@ -296,7 +296,7 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam)
|
|||
|
||||
bHung = FALSE;
|
||||
|
||||
IsHungAppWindow = (IsHungAppWindowProc)(FARPROC)GetProcAddress(GetModuleHandle(_T("USER32.DLL")), "IsHungAppWindow");
|
||||
IsHungAppWindow = (IsHungAppWindowProc)(FARPROC)GetProcAddress(GetModuleHandle(L"USER32.DLL"), "IsHungAppWindow");
|
||||
|
||||
if (IsHungAppWindow)
|
||||
bHung = IsHungAppWindow(hWnd);
|
||||
|
@ -306,7 +306,7 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void AddOrUpdateHwnd(HWND hWnd, TCHAR *szTitle, HICON hIcon, BOOL bHung)
|
||||
void AddOrUpdateHwnd(HWND hWnd, WCHAR *szTitle, HICON hIcon, BOOL bHung)
|
||||
{
|
||||
LPAPPLICATION_PAGE_LIST_ITEM pAPLI = NULL;
|
||||
HIMAGELIST hImageListLarge;
|
||||
|
@ -343,13 +343,13 @@ void AddOrUpdateHwnd(HWND hWnd, TCHAR *szTitle, HICON hIcon, BOOL bHung)
|
|||
{
|
||||
/* Check to see if anything needs updating */
|
||||
if ((pAPLI->hIcon != hIcon) ||
|
||||
(_tcsicmp(pAPLI->szTitle, szTitle) != 0) ||
|
||||
(wcsicmp(pAPLI->szTitle, szTitle) != 0) ||
|
||||
(pAPLI->bHung != bHung))
|
||||
{
|
||||
/* Update the structure */
|
||||
pAPLI->hIcon = hIcon;
|
||||
pAPLI->bHung = bHung;
|
||||
_tcscpy(pAPLI->szTitle, szTitle);
|
||||
wcscpy(pAPLI->szTitle, szTitle);
|
||||
|
||||
/* Update the image list */
|
||||
ImageList_ReplaceIcon(hImageListLarge, item.iItem, hIcon);
|
||||
|
@ -369,7 +369,7 @@ void AddOrUpdateHwnd(HWND hWnd, TCHAR *szTitle, HICON hIcon, BOOL bHung)
|
|||
pAPLI->hWnd = hWnd;
|
||||
pAPLI->hIcon = hIcon;
|
||||
pAPLI->bHung = bHung;
|
||||
_tcscpy(pAPLI->szTitle, szTitle);
|
||||
wcscpy(pAPLI->szTitle, szTitle);
|
||||
|
||||
/* Add the item to the list */
|
||||
memset(&item, 0, sizeof(LV_ITEM));
|
||||
|
@ -393,7 +393,7 @@ void AddOrUpdateHwnd(HWND hWnd, TCHAR *szTitle, HICON hIcon, BOOL bHung)
|
|||
|
||||
pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam;
|
||||
if (!IsWindow(pAPLI->hWnd)||
|
||||
(_tcslen(pAPLI->szTitle) <= 0) ||
|
||||
(wcslen(pAPLI->szTitle) <= 0) ||
|
||||
!IsWindowVisible(pAPLI->hWnd) ||
|
||||
(GetParent(pAPLI->hWnd) != NULL) ||
|
||||
(GetWindow(pAPLI->hWnd, GW_OWNER) != NULL) ||
|
||||
|
@ -492,7 +492,7 @@ void ApplicationPageOnNotify(WPARAM wParam, LPARAM lParam)
|
|||
LPNM_LISTVIEW pnmv;
|
||||
LV_DISPINFO* pnmdi;
|
||||
LPAPPLICATION_PAGE_LIST_ITEM pAPLI;
|
||||
TCHAR szMsg[256];
|
||||
WCHAR szMsg[256];
|
||||
|
||||
|
||||
idctrl = (int) wParam;
|
||||
|
@ -512,7 +512,7 @@ void ApplicationPageOnNotify(WPARAM wParam, LPARAM lParam)
|
|||
/* Update the item text */
|
||||
if (pnmdi->item.iSubItem == 0)
|
||||
{
|
||||
_tcsncpy(pnmdi->item.pszText, pAPLI->szTitle, pnmdi->item.cchTextMax);
|
||||
wcsncpy(pnmdi->item.pszText, pAPLI->szTitle, pnmdi->item.cchTextMax);
|
||||
}
|
||||
|
||||
/* Update the item status */
|
||||
|
@ -521,12 +521,12 @@ void ApplicationPageOnNotify(WPARAM wParam, LPARAM lParam)
|
|||
if (pAPLI->bHung)
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), IDS_Not_Responding , szMsg, sizeof(szMsg) / sizeof(szMsg[0]));
|
||||
_tcsncpy(pnmdi->item.pszText, szMsg, pnmdi->item.cchTextMax);
|
||||
wcsncpy(pnmdi->item.pszText, szMsg, pnmdi->item.cchTextMax);
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadString( GetModuleHandle(NULL), IDS_Running, (LPTSTR) szMsg, sizeof(szMsg) / sizeof(szMsg[0]));
|
||||
_tcsncpy(pnmdi->item.pszText, szMsg, pnmdi->item.cchTextMax);
|
||||
wcsncpy(pnmdi->item.pszText, szMsg, pnmdi->item.cchTextMax);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -876,7 +876,7 @@ void ApplicationPage_OnSwitchTo(void)
|
|||
typedef void (WINAPI *PROCSWITCHTOTHISWINDOW) (HWND, BOOL);
|
||||
PROCSWITCHTOTHISWINDOW SwitchToThisWindow;
|
||||
|
||||
HMODULE hUser32 = GetModuleHandle(_T("USER32"));
|
||||
HMODULE hUser32 = GetModuleHandle(L"USER32");
|
||||
SwitchToThisWindow = (PROCSWITCHTOTHISWINDOW)GetProcAddress(hUser32, "SwitchToThisWindow");
|
||||
if (SwitchToThisWindow) {
|
||||
SwitchToThisWindow(pAPLI->hWnd, TRUE);
|
||||
|
@ -967,5 +967,5 @@ int CALLBACK ApplicationPageCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM l
|
|||
Param1 = (LPAPPLICATION_PAGE_LIST_ITEM)lParam2;
|
||||
Param2 = (LPAPPLICATION_PAGE_LIST_ITEM)lParam1;
|
||||
}
|
||||
return _tcscmp(Param1->szTitle, Param2->szTitle);
|
||||
return wcscmp(Param1->szTitle, Param2->szTitle);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <precomp.h>
|
||||
|
||||
UINT ColumnDataHints[COLUMN_NMAX];
|
||||
TCHAR szTemp[256];
|
||||
WCHAR szTemp[256];
|
||||
|
||||
#define DECLARE_COLUMN_PRESET(_name, _size, _state) \
|
||||
{ IDS_TAB_##_name, IDC_##_name, _size, _state },
|
||||
|
@ -63,12 +63,12 @@ INT_PTR CALLBACK ColumnsDialogWndProc(HWND hDlg, UINT message, WPARAM wParam,
|
|||
void AddColumns(void)
|
||||
{
|
||||
LRESULT size;
|
||||
TCHAR szTemp[256];
|
||||
WCHAR szTemp[256];
|
||||
unsigned int n;
|
||||
|
||||
for (n=0; n<COLUMN_NMAX; n++) {
|
||||
if (TaskManagerSettings.Columns[n]) {
|
||||
LoadString(hInst, ColumnPresets[n].dwIdsName, szTemp, sizeof(szTemp)/sizeof(TCHAR));
|
||||
LoadString(hInst, ColumnPresets[n].dwIdsName, szTemp, sizeof(szTemp)/sizeof(WCHAR));
|
||||
InsertColumn(n, szTemp, LVCFMT_LEFT, TaskManagerSettings.ColumnSizeArray[n], -1);
|
||||
}
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ void SaveColumnSettings(void)
|
|||
{
|
||||
HDITEM hditem;
|
||||
unsigned int i, n;
|
||||
TCHAR text[260];
|
||||
WCHAR text[260];
|
||||
LRESULT size;
|
||||
|
||||
/* Reset column data */
|
||||
|
@ -131,8 +131,8 @@ void SaveColumnSettings(void)
|
|||
SendMessage(hProcessPageHeaderCtrl, HDM_GETITEM, i, (LPARAM) &hditem);
|
||||
|
||||
for (n=0; n<COLUMN_NMAX; n++) {
|
||||
LoadString(hInst, ColumnPresets[n].dwIdsName, szTemp, sizeof(szTemp)/sizeof(TCHAR));
|
||||
if (_tcsicmp(text, szTemp) == 0)
|
||||
LoadString(hInst, ColumnPresets[n].dwIdsName, szTemp, sizeof(szTemp)/sizeof(WCHAR));
|
||||
if (wcsicmp(text, szTemp) == 0)
|
||||
{
|
||||
TaskManagerSettings.Columns[n] = TRUE;
|
||||
TaskManagerSettings.ColumnSizeArray[n] = hditem.cxy;
|
||||
|
@ -202,9 +202,9 @@ ColumnsDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
void UpdateColumnDataHints(void)
|
||||
{
|
||||
HDITEM hditem;
|
||||
TCHAR text[260];
|
||||
WCHAR text[260];
|
||||
ULONG Index;
|
||||
TCHAR szTemp[256];
|
||||
WCHAR szTemp[256];
|
||||
unsigned int i;
|
||||
|
||||
for (Index=0; Index<(ULONG)SendMessage(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0); Index++)
|
||||
|
@ -218,8 +218,8 @@ void UpdateColumnDataHints(void)
|
|||
SendMessage(hProcessPageHeaderCtrl, HDM_GETITEM, Index, (LPARAM) &hditem);
|
||||
|
||||
for (i=0; i<COLUMN_NMAX; i++) {
|
||||
LoadString(hInst, ColumnPresets[i].dwIdsName, szTemp, sizeof(szTemp)/sizeof(TCHAR));
|
||||
if (_tcsicmp(text, szTemp) == 0)
|
||||
LoadString(hInst, ColumnPresets[i].dwIdsName, szTemp, sizeof(szTemp)/sizeof(WCHAR));
|
||||
if (wcsicmp(text, szTemp) == 0)
|
||||
ColumnDataHints[Index] = i;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,10 +69,10 @@ static DWORD get_selected_pid(void)
|
|||
return dwProcessId;
|
||||
}
|
||||
|
||||
static int list_channel_CB(HANDLE hProcess, void* addr, TCHAR* buffer, void* user)
|
||||
static int list_channel_CB(HANDLE hProcess, void* addr, WCHAR* buffer, void* user)
|
||||
{
|
||||
int j;
|
||||
TCHAR val[2];
|
||||
WCHAR val[2];
|
||||
LVITEM lvi;
|
||||
int index;
|
||||
HWND hChannelLV = (HWND)user;
|
||||
|
@ -85,10 +85,10 @@ static int list_channel_CB(HANDLE hProcess, void* addr, TCHAR* buffer, void*
|
|||
index = ListView_InsertItem(hChannelLV, &lvi);
|
||||
if (index == -1) return 0;
|
||||
|
||||
val[1] = TEXT('\0');
|
||||
val[1] = L'\0';
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
val[0] = (buffer[0] & (1 << j)) ? TEXT('x') : TEXT(' ');
|
||||
val[0] = (buffer[0] & (1 << j)) ? L'x' : L' ';
|
||||
ListView_SetItemText(hChannelLV, index, j + 1, val);
|
||||
}
|
||||
return 1;
|
||||
|
@ -107,11 +107,11 @@ struct cce_user
|
|||
*
|
||||
* Callback used for changing a given channel attributes
|
||||
*/
|
||||
static int change_channel_CB(HANDLE hProcess, void* addr, TCHAR* buffer, void* pmt)
|
||||
static int change_channel_CB(HANDLE hProcess, void* addr, WCHAR* buffer, void* pmt)
|
||||
{
|
||||
struct cce_user* user = (struct cce_user*)pmt;
|
||||
|
||||
if (!user->name || !_tcscmp(buffer + 1, user->name))
|
||||
if (!user->name || !wcscmp(buffer + 1, user->name))
|
||||
{
|
||||
buffer[0] = (buffer[0] & ~user->mask) | (user->value & user->mask);
|
||||
if (WriteProcessMemory(hProcess, addr, buffer, 1, NULL))
|
||||
|
@ -222,7 +222,7 @@ struct dll_option_layout
|
|||
unsigned int nb_channels;
|
||||
};
|
||||
|
||||
typedef int (*EnumChannelCB)(HANDLE, void*, TCHAR*, void*);
|
||||
typedef int (*EnumChannelCB)(HANDLE, void*, WCHAR*, void*);
|
||||
|
||||
/******************************************************************
|
||||
* enum_channel
|
||||
|
@ -235,15 +235,15 @@ static int enum_channel(HANDLE hProcess, EnumChannelCB ce, void* user, unsigned
|
|||
struct dll_option_layout dol;
|
||||
int ret = 1;
|
||||
void* buf_addr;
|
||||
TCHAR buffer[32];
|
||||
WCHAR buffer[32];
|
||||
void* addr;
|
||||
const TCHAR** cache = NULL;
|
||||
const WCHAR** cache = NULL;
|
||||
unsigned i, j, num_cache, used_cache;
|
||||
|
||||
addr = get_symbol(hProcess, "first_dll", "libwine.so");
|
||||
if (!addr) return -1;
|
||||
if (unique)
|
||||
cache = HeapAlloc(GetProcessHeap(), 0, (num_cache = 32) * sizeof(TCHAR*));
|
||||
cache = HeapAlloc(GetProcessHeap(), 0, (num_cache = 32) * sizeof(WCHAR*));
|
||||
else
|
||||
num_cache = 0;
|
||||
used_cache = 0;
|
||||
|
@ -265,11 +265,11 @@ static int enum_channel(HANDLE hProcess, EnumChannelCB ce, void* user, unsigned
|
|||
* them again
|
||||
*/
|
||||
for (j = 0; j < used_cache; j++)
|
||||
if (!_tcscmp(cache[j], buffer + 1)) break;
|
||||
if (!wcscmp(cache[j], buffer + 1)) break;
|
||||
if (j != used_cache) continue;
|
||||
if (used_cache == num_cache)
|
||||
cache = HeapReAlloc(GetProcessHeap(), 0, cache, (num_cache *= 2) * sizeof(TCHAR*));
|
||||
cache[used_cache++] = _tcscpy(HeapAlloc(GetProcessHeap(), 0, (_tcslen(buffer + 1) + 1) * sizeof(TCHAR)),
|
||||
cache = HeapReAlloc(GetProcessHeap(), 0, cache, (num_cache *= 2) * sizeof(WCHAR*));
|
||||
cache[used_cache++] = wcscpy(HeapAlloc(GetProcessHeap(), 0, (wcslen(buffer + 1) + 1) * sizeof(WCHAR)),
|
||||
buffer + 1);
|
||||
}
|
||||
ret = ce(hProcess, buf_addr, buffer, user);
|
||||
|
@ -278,7 +278,7 @@ static int enum_channel(HANDLE hProcess, EnumChannelCB ce, void* user, unsigned
|
|||
}
|
||||
if (unique)
|
||||
{
|
||||
for (j = 0; j < used_cache; j++) HeapFree(GetProcessHeap(), 0, (TCHAR*)cache[j]);
|
||||
for (j = 0; j < used_cache; j++) HeapFree(GetProcessHeap(), 0, (WCHAR*)cache[j]);
|
||||
HeapFree(GetProcessHeap(), 0, cache);
|
||||
}
|
||||
return 0;
|
||||
|
@ -305,31 +305,31 @@ static void DebugChannels_OnCreate(HWND hwndDlg)
|
|||
|
||||
lvc.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
|
||||
lvc.fmt = LVCFMT_LEFT;
|
||||
lvc.pszText = _T("Debug Channel");
|
||||
lvc.pszText = L"Debug Channel";
|
||||
lvc.cx = 100;
|
||||
(void)ListView_InsertColumn(hLV, 0, &lvc);
|
||||
|
||||
lvc.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
|
||||
lvc.fmt = LVCFMT_CENTER;
|
||||
lvc.pszText = _T("Fixme");
|
||||
lvc.pszText = L"Fixme";
|
||||
lvc.cx = 55;
|
||||
(void)ListView_InsertColumn(hLV, 1, &lvc);
|
||||
|
||||
lvc.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
|
||||
lvc.fmt = LVCFMT_CENTER;
|
||||
lvc.pszText = _T("Err");
|
||||
lvc.pszText = L"Err";
|
||||
lvc.cx = 55;
|
||||
(void)ListView_InsertColumn(hLV, 2, &lvc);
|
||||
|
||||
lvc.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
|
||||
lvc.fmt = LVCFMT_CENTER;
|
||||
lvc.pszText = _T("Warn");
|
||||
lvc.pszText = L"Warn";
|
||||
lvc.cx = 55;
|
||||
(void)ListView_InsertColumn(hLV, 3, &lvc);
|
||||
|
||||
lvc.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
|
||||
lvc.fmt = LVCFMT_CENTER;
|
||||
lvc.pszText = _T("Trace");
|
||||
lvc.pszText = L"Trace";
|
||||
lvc.cx = 55;
|
||||
(void)ListView_InsertColumn(hLV, 4, &lvc);
|
||||
|
||||
|
@ -357,21 +357,21 @@ static void DebugChannels_OnNotify(HWND hDlg, LPARAM lParam)
|
|||
SendMessage(hChannelLV, LVM_SUBITEMHITTEST, 0, (LPARAM)&lhti);
|
||||
if (nmia->iSubItem >= 1 && nmia->iSubItem <= 4)
|
||||
{
|
||||
TCHAR val[2];
|
||||
TCHAR name[32];
|
||||
WCHAR val[2];
|
||||
WCHAR name[32];
|
||||
unsigned bitmask = 1 << (lhti.iSubItem - 1);
|
||||
struct cce_user user;
|
||||
|
||||
ListView_GetItemText(hChannelLV, lhti.iItem, 0, name, sizeof(name) / sizeof(name[0]));
|
||||
ListView_GetItemText(hChannelLV, lhti.iItem, lhti.iSubItem, val, sizeof(val) / sizeof(val[0]));
|
||||
user.name = name;
|
||||
user.value = (val[0] == TEXT('x')) ? 0 : bitmask;
|
||||
user.value = (val[0] == L'x') ? 0 : bitmask;
|
||||
user.mask = bitmask;
|
||||
user.done = user.notdone = 0;
|
||||
enum_channel(hProcess, change_channel_CB, &user, FALSE);
|
||||
if (user.done)
|
||||
{
|
||||
val[0] ^= (TEXT('x') ^ TEXT(' '));
|
||||
val[0] ^= (L'x' ^ L' ');
|
||||
ListView_SetItemText(hChannelLV, lhti.iItem, lhti.iSubItem, val);
|
||||
}
|
||||
if (user.notdone)
|
||||
|
|
|
@ -28,16 +28,16 @@ void ProcessPage_OnDebug(void)
|
|||
LVITEM lvitem;
|
||||
ULONG Index;
|
||||
DWORD dwProcessId;
|
||||
TCHAR strErrorText[260];
|
||||
WCHAR strErrorText[260];
|
||||
HKEY hKey;
|
||||
TCHAR strDebugPath[260];
|
||||
TCHAR strDebugger[260];
|
||||
WCHAR strDebugPath[260];
|
||||
WCHAR strDebugger[260];
|
||||
DWORD dwDebuggerSize;
|
||||
PROCESS_INFORMATION pi;
|
||||
STARTUPINFO si;
|
||||
HANDLE hDebugEvent;
|
||||
TCHAR szTemp[256];
|
||||
TCHAR szTempA[256];
|
||||
WCHAR szTemp[256];
|
||||
WCHAR szTempA[256];
|
||||
|
||||
|
||||
for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++)
|
||||
|
@ -70,7 +70,7 @@ void ProcessPage_OnDebug(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug"), 0, KEY_READ, &hKey) != ERROR_SUCCESS)
|
||||
if (RegOpenKeyEx(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);
|
||||
|
@ -79,7 +79,7 @@ void ProcessPage_OnDebug(void)
|
|||
}
|
||||
|
||||
dwDebuggerSize = 260;
|
||||
if (RegQueryValueEx(hKey, _T("Debugger"), NULL, NULL, (LPBYTE)strDebugger, &dwDebuggerSize) != ERROR_SUCCESS)
|
||||
if (RegQueryValueEx(hKey, L"Debugger", NULL, NULL, (LPBYTE)strDebugger, &dwDebuggerSize) != ERROR_SUCCESS)
|
||||
{
|
||||
GetLastErrorText(strErrorText, 260);
|
||||
LoadString(hInst, IDS_MSG_UNABLEDEBUGPROCESS, szTemp, 256);
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
|
||||
#include <precomp.h>
|
||||
|
||||
TCHAR szTemp[256];
|
||||
TCHAR szTempA[256];
|
||||
WCHAR szTemp[256];
|
||||
WCHAR szTempA[256];
|
||||
|
||||
void ProcessPage_OnEndProcess(void)
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ void ProcessPage_OnEndProcess(void)
|
|||
ULONG Index;
|
||||
DWORD dwProcessId;
|
||||
HANDLE hProcess;
|
||||
TCHAR strErrorText[260];
|
||||
WCHAR strErrorText[260];
|
||||
|
||||
for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++)
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ void ProcessPage_OnEndProcessTree(void)
|
|||
ULONG Index;
|
||||
DWORD dwProcessId;
|
||||
HANDLE hProcess;
|
||||
TCHAR strErrorText[260];
|
||||
WCHAR strErrorText[260];
|
||||
|
||||
for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++)
|
||||
{
|
||||
|
|
|
@ -136,7 +136,7 @@ void Graph_DrawCpuUsageGraph(HDC hDC, HWND hWnd)
|
|||
RECT rcBarRight;
|
||||
RECT rcText;
|
||||
COLORREF crPrevForeground;
|
||||
TCHAR Text[260];
|
||||
WCHAR Text[260];
|
||||
HFONT hOldFont;
|
||||
ULONG CpuUsage;
|
||||
ULONG CpuKernelUsage;
|
||||
|
@ -166,7 +166,7 @@ void Graph_DrawCpuUsageGraph(HDC hDC, HWND hWnd)
|
|||
if (CpuUsage <= 0) CpuUsage = 0;
|
||||
if (CpuUsage > 100) CpuUsage = 100;
|
||||
|
||||
_stprintf(Text, _T("%d%%"), (int)CpuUsage);
|
||||
wsprintf(Text, L"%d%%", (int)CpuUsage);
|
||||
|
||||
/*
|
||||
* Draw the font text onto the graph
|
||||
|
@ -307,7 +307,7 @@ void Graph_DrawMemUsageGraph(HDC hDC, HWND hWnd)
|
|||
RECT rcBarRight;
|
||||
RECT rcText;
|
||||
COLORREF crPrevForeground;
|
||||
TCHAR Text[260];
|
||||
WCHAR Text[260];
|
||||
HFONT hOldFont;
|
||||
ULONGLONG CommitChargeTotal;
|
||||
ULONGLONG CommitChargeLimit;
|
||||
|
@ -335,9 +335,9 @@ void Graph_DrawMemUsageGraph(HDC hDC, HWND hWnd)
|
|||
CommitChargeLimit = (ULONGLONG)PerfDataGetCommitChargeLimitK();
|
||||
|
||||
if (CommitChargeTotal > 1024)
|
||||
_stprintf(Text, _T("%d MB"), (int)(CommitChargeTotal / 1024));
|
||||
wsprintf(Text, L"%d MB", (int)(CommitChargeTotal / 1024));
|
||||
else
|
||||
_stprintf(Text, _T("%d K"), (int)CommitChargeTotal);
|
||||
wsprintf(Text, L"%d K", (int)CommitChargeTotal);
|
||||
/*
|
||||
* Draw the font text onto the graph
|
||||
*/
|
||||
|
|
|
@ -301,12 +301,12 @@ void GraphCtrl_InvalidateCtrl(TGraphCtrl* this, BOOL bResize)
|
|||
SetTextColor(m_dcGrid, m_crGridColor);
|
||||
SetTextAlign(m_dcGrid, TA_RIGHT|TA_TOP);
|
||||
sprintf(strTemp, "%.*lf", m_nYDecimals, m_dUpperLimit);
|
||||
TextOut(m_dcGrid, m_rectPlot.left-4, m_rectPlot.top, strTemp, _tcslen(strTemp));
|
||||
TextOut(m_dcGrid, m_rectPlot.left-4, m_rectPlot.top, strTemp, wcslen(strTemp));
|
||||
|
||||
/* y min */
|
||||
SetTextAlign(m_dcGrid, TA_RIGHT|TA_BASELINE);
|
||||
sprintf(strTemp, "%.*lf", m_nYDecimals, m_dLowerLimit);
|
||||
TextOut(m_dcGrid, m_rectPlot.left-4, m_rectPlot.bottom, strTemp, _tcslen(strTemp));
|
||||
TextOut(m_dcGrid, m_rectPlot.left-4, m_rectPlot.bottom, strTemp, wcslen(strTemp));
|
||||
|
||||
/* x min */
|
||||
SetTextAlign(m_dcGrid, TA_LEFT|TA_TOP);
|
||||
|
@ -315,12 +315,12 @@ void GraphCtrl_InvalidateCtrl(TGraphCtrl* this, BOOL bResize)
|
|||
/* x max */
|
||||
SetTextAlign(m_dcGrid, TA_RIGHT|TA_TOP);
|
||||
sprintf(strTemp, "%d", m_nPlotWidth/m_nShiftPixels);
|
||||
TextOut(m_dcGrid, m_rectPlot.right, m_rectPlot.bottom+4, strTemp, _tcslen(strTemp));
|
||||
TextOut(m_dcGrid, m_rectPlot.right, m_rectPlot.bottom+4, strTemp, wcslen(strTemp));
|
||||
|
||||
/* x units */
|
||||
SetTextAlign(m_dcGrid, TA_CENTER|TA_TOP);
|
||||
TextOut(m_dcGrid, (m_rectPlot.left+m_rectPlot.right)/2,
|
||||
m_rectPlot.bottom+4, m_strXUnitsString, _tcslen(m_strXUnitsString));
|
||||
m_rectPlot.bottom+4, m_strXUnitsString, wcslen(m_strXUnitsString));
|
||||
|
||||
/* restore the font */
|
||||
SelectObject(m_dcGrid, oldFont);
|
||||
|
@ -329,7 +329,7 @@ void GraphCtrl_InvalidateCtrl(TGraphCtrl* this, BOOL bResize)
|
|||
oldFont = (HFONT)SelectObject(m_dcGrid, yUnitFont);
|
||||
SetTextAlign(m_dcGrid, TA_CENTER|TA_BASELINE);
|
||||
TextOut(m_dcGrid, (m_rectClient.left+m_rectPlot.left)/2,
|
||||
(m_rectPlot.bottom+m_rectPlot.top)/2, m_strYUnitsString, _tcslen(m_strYUnitsString));
|
||||
(m_rectPlot.bottom+m_rectPlot.top)/2, m_strYUnitsString, wcslen(m_strYUnitsString));
|
||||
SelectObject(m_dcGrid, oldFont);
|
||||
#endif
|
||||
/* at this point we are done filling the the grid bitmap, */
|
||||
|
|
|
@ -78,7 +78,7 @@ void PerfDataUninitialize(void)
|
|||
|
||||
static void SidToUserName(PSID Sid, LPTSTR szBuffer, DWORD BufferSize)
|
||||
{
|
||||
static TCHAR szDomainNameUnused[255];
|
||||
static WCHAR szDomainNameUnused[255];
|
||||
DWORD DomainNameLen = sizeof(szDomainNameUnused) / sizeof(szDomainNameUnused[0]);
|
||||
SID_NAME_USE Use;
|
||||
|
||||
|
@ -260,7 +260,7 @@ void PerfDataRefresh(void)
|
|||
if (pSPI->ImageName.Buffer)
|
||||
wcscpy(pPerfData[Idx].ImageName, pSPI->ImageName.Buffer);
|
||||
else
|
||||
LoadStringW(hInst, IDS_IDLE_PROCESS, pPerfData[Idx].ImageName,
|
||||
LoadString(hInst, IDS_IDLE_PROCESS, pPerfData[Idx].ImageName,
|
||||
sizeof(pPerfData[Idx].ImageName) / sizeof(pPerfData[Idx].ImageName[0]));
|
||||
|
||||
pPerfData[Idx].ProcessId = pSPI->UniqueProcessId;
|
||||
|
@ -291,7 +291,7 @@ void PerfDataRefresh(void)
|
|||
pPerfData[Idx].HandleCount = pSPI->HandleCount;
|
||||
pPerfData[Idx].ThreadCount = pSPI->NumberOfThreads;
|
||||
pPerfData[Idx].SessionId = pSPI->SessionId;
|
||||
pPerfData[Idx].UserName[0] = _T('\0');
|
||||
pPerfData[Idx].UserName[0] = L'\0';
|
||||
pPerfData[Idx].USERObjectCount = 0;
|
||||
pPerfData[Idx].GDIObjectCount = 0;
|
||||
ProcessUser = SystemUserSid;
|
||||
|
@ -375,12 +375,7 @@ BOOL PerfDataGetImageName(ULONG Index, LPTSTR lpImageName, int nMaxCount)
|
|||
EnterCriticalSection(&PerfDataCriticalSection);
|
||||
|
||||
if (Index < ProcessCount) {
|
||||
#ifdef _UNICODE
|
||||
wcsncpy(lpImageName, pPerfData[Index].ImageName, nMaxCount);
|
||||
#else
|
||||
WideCharToMultiByte(CP_ACP, 0, pPerfData[Index].ImageName, -1, lpImageName, nMaxCount, NULL, NULL);
|
||||
#endif
|
||||
|
||||
bSuccessful = TRUE;
|
||||
} else {
|
||||
bSuccessful = FALSE;
|
||||
|
@ -432,12 +427,7 @@ BOOL PerfDataGetUserName(ULONG Index, LPTSTR lpUserName, int nMaxCount)
|
|||
EnterCriticalSection(&PerfDataCriticalSection);
|
||||
|
||||
if (Index < ProcessCount) {
|
||||
#ifdef _UNICODE
|
||||
wcsncpy(lpUserName, pPerfData[Index].UserName, nMaxCount);
|
||||
#else
|
||||
WideCharToMultiByte(CP_ACP, 0, pPerfData[Index].UserName, -1, lpUserName, nMaxCount, NULL, NULL);
|
||||
#endif
|
||||
|
||||
bSuccessful = TRUE;
|
||||
} else {
|
||||
bSuccessful = FALSE;
|
||||
|
|
|
@ -329,8 +329,8 @@ DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
|
|||
ULONG TotalThreads;
|
||||
ULONG TotalProcesses;
|
||||
|
||||
TCHAR Text[260];
|
||||
TCHAR szMemUsage[256];
|
||||
WCHAR Text[260];
|
||||
WCHAR szMemUsage[256];
|
||||
|
||||
/* Create the event */
|
||||
hPerformancePageEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
|
||||
|
@ -367,11 +367,11 @@ DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
|
|||
CommitChargeTotal = PerfDataGetCommitChargeTotalK();
|
||||
CommitChargeLimit = PerfDataGetCommitChargeLimitK();
|
||||
CommitChargePeak = PerfDataGetCommitChargePeakK();
|
||||
_ultot(CommitChargeTotal, Text, 10);
|
||||
_ultow(CommitChargeTotal, Text, 10);
|
||||
SetWindowText(hPerformancePageCommitChargeTotalEdit, Text);
|
||||
_ultot(CommitChargeLimit, Text, 10);
|
||||
_ultow(CommitChargeLimit, Text, 10);
|
||||
SetWindowText(hPerformancePageCommitChargeLimitEdit, Text);
|
||||
_ultot(CommitChargePeak, Text, 10);
|
||||
_ultow(CommitChargePeak, Text, 10);
|
||||
SetWindowText(hPerformancePageCommitChargePeakEdit, Text);
|
||||
wsprintf(Text, szMemUsage, CommitChargeTotal, CommitChargeLimit);
|
||||
SendMessage(hStatusWnd, SB_SETTEXT, 2, (LPARAM)Text);
|
||||
|
@ -382,11 +382,11 @@ DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
|
|||
KernelMemoryTotal = PerfDataGetKernelMemoryTotalK();
|
||||
KernelMemoryPaged = PerfDataGetKernelMemoryPagedK();
|
||||
KernelMemoryNonPaged = PerfDataGetKernelMemoryNonPagedK();
|
||||
_ultot(KernelMemoryTotal, Text, 10);
|
||||
_ultow(KernelMemoryTotal, Text, 10);
|
||||
SetWindowText(hPerformancePageKernelMemoryTotalEdit, Text);
|
||||
_ultot(KernelMemoryPaged, Text, 10);
|
||||
_ultow(KernelMemoryPaged, Text, 10);
|
||||
SetWindowText(hPerformancePageKernelMemoryPagedEdit, Text);
|
||||
_ultot(KernelMemoryNonPaged, Text, 10);
|
||||
_ultow(KernelMemoryNonPaged, Text, 10);
|
||||
SetWindowText(hPerformancePageKernelMemoryNonPagedEdit, Text);
|
||||
|
||||
/*
|
||||
|
@ -395,11 +395,11 @@ DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
|
|||
PhysicalMemoryTotal = PerfDataGetPhysicalMemoryTotalK();
|
||||
PhysicalMemoryAvailable = PerfDataGetPhysicalMemoryAvailableK();
|
||||
PhysicalMemorySystemCache = PerfDataGetPhysicalMemorySystemCacheK();
|
||||
_ultot(PhysicalMemoryTotal, Text, 10);
|
||||
_ultow(PhysicalMemoryTotal, Text, 10);
|
||||
SetWindowText(hPerformancePagePhysicalMemoryTotalEdit, Text);
|
||||
_ultot(PhysicalMemoryAvailable, Text, 10);
|
||||
_ultow(PhysicalMemoryAvailable, Text, 10);
|
||||
SetWindowText(hPerformancePagePhysicalMemoryAvailableEdit, Text);
|
||||
_ultot(PhysicalMemorySystemCache, Text, 10);
|
||||
_ultow(PhysicalMemorySystemCache, Text, 10);
|
||||
SetWindowText(hPerformancePagePhysicalMemorySystemCacheEdit, Text);
|
||||
|
||||
/*
|
||||
|
@ -408,11 +408,11 @@ DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
|
|||
TotalHandles = PerfDataGetSystemHandleCount();
|
||||
TotalThreads = PerfDataGetTotalThreadCount();
|
||||
TotalProcesses = PerfDataGetProcessCount();
|
||||
_ultot(TotalHandles, Text, 10);
|
||||
_ultow(TotalHandles, Text, 10);
|
||||
SetWindowText(hPerformancePageTotalsHandleCountEdit, Text);
|
||||
_ultot(TotalThreads, Text, 10);
|
||||
_ultow(TotalThreads, Text, 10);
|
||||
SetWindowText(hPerformancePageTotalsThreadCountEdit, Text);
|
||||
_ultot(TotalProcesses, Text, 10);
|
||||
_ultow(TotalProcesses, Text, 10);
|
||||
SetWindowText(hPerformancePageTotalsProcessCountEdit, Text);
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
#ifndef __PRECOMP_H
|
||||
#define __PRECOMP_H
|
||||
|
||||
#ifndef UNICODE
|
||||
#error Task-Manager uses NDK functions, so it can only be compiled with Unicode support enabled!
|
||||
#endif
|
||||
|
||||
#define WIN32_NO_STATUS
|
||||
#include <windows.h>
|
||||
#define NTOS_MODE_USER
|
||||
|
@ -10,7 +14,6 @@
|
|||
#include <aclapi.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <tchar.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
|
||||
#include <precomp.h>
|
||||
|
||||
TCHAR szTemp[256];
|
||||
TCHAR szTempA[256];
|
||||
WCHAR szTemp[256];
|
||||
WCHAR szTempA[256];
|
||||
|
||||
void ProcessPage_OnSetPriorityRealTime(void)
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ void ProcessPage_OnSetPriorityRealTime(void)
|
|||
ULONG Index;
|
||||
DWORD dwProcessId;
|
||||
HANDLE hProcess;
|
||||
TCHAR strErrorText[260];
|
||||
WCHAR strErrorText[260];
|
||||
|
||||
for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++)
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ void ProcessPage_OnSetPriorityHigh(void)
|
|||
ULONG Index;
|
||||
DWORD dwProcessId;
|
||||
HANDLE hProcess;
|
||||
TCHAR strErrorText[260];
|
||||
WCHAR strErrorText[260];
|
||||
|
||||
for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++)
|
||||
{
|
||||
|
@ -136,7 +136,7 @@ void ProcessPage_OnSetPriorityAboveNormal(void)
|
|||
ULONG Index;
|
||||
DWORD dwProcessId;
|
||||
HANDLE hProcess;
|
||||
TCHAR strErrorText[260];
|
||||
WCHAR strErrorText[260];
|
||||
|
||||
for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++)
|
||||
{
|
||||
|
@ -188,7 +188,7 @@ void ProcessPage_OnSetPriorityNormal(void)
|
|||
ULONG Index;
|
||||
DWORD dwProcessId;
|
||||
HANDLE hProcess;
|
||||
TCHAR strErrorText[260];
|
||||
WCHAR strErrorText[260];
|
||||
|
||||
for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++)
|
||||
{
|
||||
|
@ -240,7 +240,7 @@ void ProcessPage_OnSetPriorityBelowNormal(void)
|
|||
ULONG Index;
|
||||
DWORD dwProcessId;
|
||||
HANDLE hProcess;
|
||||
TCHAR strErrorText[260];
|
||||
WCHAR strErrorText[260];
|
||||
|
||||
for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++)
|
||||
{
|
||||
|
@ -292,7 +292,7 @@ void ProcessPage_OnSetPriorityLow(void)
|
|||
ULONG Index;
|
||||
DWORD dwProcessId;
|
||||
HANDLE hProcess;
|
||||
TCHAR strErrorText[260];
|
||||
WCHAR strErrorText[260];
|
||||
|
||||
for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++)
|
||||
{
|
||||
|
|
|
@ -72,7 +72,7 @@ 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, _T("Processes"));
|
||||
SetWindowText(hProcessPageListCtrl, L"Processes");
|
||||
(void)ListView_SetExtendedListViewStyle(hProcessPageListCtrl, ListView_GetExtendedListViewStyle(hProcessPageListCtrl) | LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP);
|
||||
|
||||
AddColumns();
|
||||
|
@ -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, _T("%d"), PerfDataGetProcessId(Index));
|
||||
wsprintf(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, _T("%d"), PerfDataGetSessionId(Index));
|
||||
wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetSessionId(Index));
|
||||
if (ColumnDataHints[ColumnIndex] == COLUMN_CPUUSAGE)
|
||||
wsprintf(pnmdi->item.pszText, _T("%02d"), PerfDataGetCPUUsage(Index));
|
||||
wsprintf(pnmdi->item.pszText, L"%02d", PerfDataGetCPUUsage(Index));
|
||||
if (ColumnDataHints[ColumnIndex] == COLUMN_CPUTIME)
|
||||
{
|
||||
DWORD dwHours;
|
||||
|
@ -212,120 +212,116 @@ void ProcessPageOnNotify(WPARAM wParam, LPARAM lParam)
|
|||
dwMinutes = (DWORD)((time.QuadPart % 36000000000LL) / 600000000LL);
|
||||
dwSeconds = (DWORD)(((time.QuadPart % 36000000000LL) % 600000000LL) / 10000000LL);
|
||||
#endif
|
||||
wsprintf(pnmdi->item.pszText, _T("%d:%02d:%02d"), dwHours, dwMinutes, dwSeconds);
|
||||
wsprintf(pnmdi->item.pszText, L"%d:%02d:%02d", dwHours, dwMinutes, dwSeconds);
|
||||
}
|
||||
if (ColumnDataHints[ColumnIndex] == COLUMN_MEMORYUSAGE)
|
||||
{
|
||||
wsprintf(pnmdi->item.pszText, _T("%d"), PerfDataGetWorkingSetSizeBytes(Index) / 1024);
|
||||
wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetWorkingSetSizeBytes(Index) / 1024);
|
||||
CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax);
|
||||
_tcscat(pnmdi->item.pszText, _T(" K"));
|
||||
wcscat(pnmdi->item.pszText, L" K");
|
||||
}
|
||||
if (ColumnDataHints[ColumnIndex] == COLUMN_PEAKMEMORYUSAGE)
|
||||
{
|
||||
wsprintf(pnmdi->item.pszText, _T("%d"), PerfDataGetPeakWorkingSetSizeBytes(Index) / 1024);
|
||||
wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetPeakWorkingSetSizeBytes(Index) / 1024);
|
||||
CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax);
|
||||
_tcscat(pnmdi->item.pszText, _T(" K"));
|
||||
wcscat(pnmdi->item.pszText, L" K");
|
||||
}
|
||||
if (ColumnDataHints[ColumnIndex] == COLUMN_MEMORYUSAGEDELTA)
|
||||
{
|
||||
wsprintf(pnmdi->item.pszText, _T("%d"), PerfDataGetWorkingSetSizeDelta(Index) / 1024);
|
||||
wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetWorkingSetSizeDelta(Index) / 1024);
|
||||
CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax);
|
||||
_tcscat(pnmdi->item.pszText, _T(" K"));
|
||||
wcscat(pnmdi->item.pszText, L" K");
|
||||
}
|
||||
if (ColumnDataHints[ColumnIndex] == COLUMN_PAGEFAULTS)
|
||||
{
|
||||
wsprintf(pnmdi->item.pszText, _T("%d"), PerfDataGetPageFaultCount(Index));
|
||||
wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetPageFaultCount(Index));
|
||||
CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax);
|
||||
}
|
||||
if (ColumnDataHints[ColumnIndex] == COLUMN_PAGEFAULTSDELTA)
|
||||
{
|
||||
wsprintf(pnmdi->item.pszText, _T("%d"), PerfDataGetPageFaultCountDelta(Index));
|
||||
wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetPageFaultCountDelta(Index));
|
||||
CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax);
|
||||
}
|
||||
if (ColumnDataHints[ColumnIndex] == COLUMN_VIRTUALMEMORYSIZE)
|
||||
{
|
||||
wsprintf(pnmdi->item.pszText, _T("%d"), PerfDataGetVirtualMemorySizeBytes(Index) / 1024);
|
||||
wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetVirtualMemorySizeBytes(Index) / 1024);
|
||||
CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax);
|
||||
_tcscat(pnmdi->item.pszText, _T(" K"));
|
||||
wcscat(pnmdi->item.pszText, L" K");
|
||||
}
|
||||
if (ColumnDataHints[ColumnIndex] == COLUMN_PAGEDPOOL)
|
||||
{
|
||||
wsprintf(pnmdi->item.pszText, _T("%d"), PerfDataGetPagedPoolUsagePages(Index) / 1024);
|
||||
wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetPagedPoolUsagePages(Index) / 1024);
|
||||
CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax);
|
||||
_tcscat(pnmdi->item.pszText, _T(" K"));
|
||||
wcscat(pnmdi->item.pszText, L" K");
|
||||
}
|
||||
if (ColumnDataHints[ColumnIndex] == COLUMN_NONPAGEDPOOL)
|
||||
{
|
||||
wsprintf(pnmdi->item.pszText, _T("%d"), PerfDataGetNonPagedPoolUsagePages(Index) / 1024);
|
||||
wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetNonPagedPoolUsagePages(Index) / 1024);
|
||||
CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax);
|
||||
_tcscat(pnmdi->item.pszText, _T(" K"));
|
||||
wcscat(pnmdi->item.pszText, L" K");
|
||||
}
|
||||
if (ColumnDataHints[ColumnIndex] == COLUMN_BASEPRIORITY)
|
||||
wsprintf(pnmdi->item.pszText, _T("%d"), PerfDataGetBasePriority(Index));
|
||||
wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetBasePriority(Index));
|
||||
if (ColumnDataHints[ColumnIndex] == COLUMN_HANDLECOUNT)
|
||||
{
|
||||
wsprintf(pnmdi->item.pszText, _T("%d"), PerfDataGetHandleCount(Index));
|
||||
wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetHandleCount(Index));
|
||||
CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax);
|
||||
}
|
||||
if (ColumnDataHints[ColumnIndex] == COLUMN_THREADCOUNT)
|
||||
{
|
||||
wsprintf(pnmdi->item.pszText, _T("%d"), PerfDataGetThreadCount(Index));
|
||||
wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetThreadCount(Index));
|
||||
CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax);
|
||||
}
|
||||
if (ColumnDataHints[ColumnIndex] == COLUMN_USEROBJECTS)
|
||||
{
|
||||
wsprintf(pnmdi->item.pszText, _T("%d"), PerfDataGetUSERObjectCount(Index));
|
||||
wsprintf(pnmdi->item.pszText, L"%d", PerfDataGetUSERObjectCount(Index));
|
||||
CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax);
|
||||
}
|
||||
if (ColumnDataHints[ColumnIndex] == COLUMN_GDIOBJECTS)
|
||||
{
|
||||
wsprintf(pnmdi->item.pszText, _T("%d"), PerfDataGetGDIObjectCount(Index));
|
||||
wsprintf(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, _T("%d"), iocounters.ReadOperationCount); */
|
||||
#ifdef UNICODE
|
||||
#define _ui64toa _ui64tow
|
||||
#else
|
||||
#endif
|
||||
_ui64toa(iocounters.ReadOperationCount, pnmdi->item.pszText, 10);
|
||||
/* wsprintf(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, _T("%d"), iocounters.WriteOperationCount); */
|
||||
_ui64toa(iocounters.WriteOperationCount, pnmdi->item.pszText, 10);
|
||||
/* wsprintf(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, _T("%d"), iocounters.OtherOperationCount); */
|
||||
_ui64toa(iocounters.OtherOperationCount, pnmdi->item.pszText, 10);
|
||||
/* wsprintf(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, _T("%d"), iocounters.ReadTransferCount); */
|
||||
_ui64toa(iocounters.ReadTransferCount, pnmdi->item.pszText, 10);
|
||||
/* wsprintf(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, _T("%d"), iocounters.WriteTransferCount); */
|
||||
_ui64toa(iocounters.WriteTransferCount, pnmdi->item.pszText, 10);
|
||||
/* wsprintf(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, _T("%d"), iocounters.OtherTransferCount); */
|
||||
_ui64toa(iocounters.OtherTransferCount, pnmdi->item.pszText, 10);
|
||||
/* wsprintf(pnmdi->item.pszText, L"%d", iocounters.OtherTransferCount); */
|
||||
_ui64tow(iocounters.OtherTransferCount, pnmdi->item.pszText, 10);
|
||||
CommaSeparateNumberString(pnmdi->item.pszText, pnmdi->item.cchTextMax);
|
||||
}
|
||||
|
||||
|
@ -391,18 +387,18 @@ void ProcessPageOnNotify(WPARAM wParam, LPARAM lParam)
|
|||
|
||||
void CommaSeparateNumberString(LPTSTR strNumber, int nMaxCount)
|
||||
{
|
||||
TCHAR temp[260];
|
||||
WCHAR temp[260];
|
||||
UINT i, j, k;
|
||||
|
||||
for (i=0,j=0; i<(_tcslen(strNumber) % 3); i++, j++)
|
||||
for (i=0,j=0; i<(wcslen(strNumber) % 3); i++, j++)
|
||||
temp[j] = strNumber[i];
|
||||
for (k=0; i<_tcslen(strNumber); i++,j++,k++) {
|
||||
for (k=0; i<wcslen(strNumber); i++,j++,k++) {
|
||||
if ((k % 3 == 0) && (j > 0))
|
||||
temp[j++] = _T(',');
|
||||
temp[j++] = L',';
|
||||
temp[j] = strNumber[i];
|
||||
}
|
||||
temp[j] = _T('\0');
|
||||
_tcsncpy(strNumber, temp, nMaxCount);
|
||||
temp[j] = L'\0';
|
||||
wcsncpy(strNumber, temp, nMaxCount);
|
||||
}
|
||||
|
||||
void ProcessPageShowContextMenu(DWORD dwProcessId)
|
||||
|
@ -414,7 +410,7 @@ void ProcessPageShowContextMenu(DWORD dwProcessId)
|
|||
SYSTEM_INFO si;
|
||||
HANDLE hProcess;
|
||||
DWORD dwProcessPriorityClass;
|
||||
TCHAR strDebugger[260];
|
||||
WCHAR strDebugger[260];
|
||||
DWORD dwDebuggerSize;
|
||||
HKEY hKey;
|
||||
UINT Idx;
|
||||
|
@ -459,15 +455,15 @@ void ProcessPageShowContextMenu(DWORD dwProcessId)
|
|||
break;
|
||||
}
|
||||
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug"), 0, KEY_READ, &hKey) == ERROR_SUCCESS)
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug", 0, KEY_READ, &hKey) == ERROR_SUCCESS)
|
||||
{
|
||||
dwDebuggerSize = 260;
|
||||
if (RegQueryValueEx(hKey, _T("Debugger"), NULL, NULL, (LPBYTE)strDebugger, &dwDebuggerSize) == ERROR_SUCCESS)
|
||||
if (RegQueryValueEx(hKey, L"Debugger", NULL, NULL, (LPBYTE)strDebugger, &dwDebuggerSize) == ERROR_SUCCESS)
|
||||
{
|
||||
for (Idx=0; Idx<_tcslen(strDebugger); Idx++)
|
||||
for (Idx=0; Idx<wcslen(strDebugger); Idx++)
|
||||
strDebugger[Idx] = toupper(strDebugger[Idx]);
|
||||
|
||||
if (_tcsstr(strDebugger, _T("DRWTSN32")))
|
||||
if (wcsstr(strDebugger, L"DRWTSN32"))
|
||||
EnableMenuItem(hSubMenu, ID_PROCESS_PAGE_DEBUG, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED);
|
||||
}
|
||||
else
|
||||
|
@ -492,7 +488,7 @@ DWORD WINAPI ProcessPageRefreshThread(void *lpParameter)
|
|||
{
|
||||
ULONG OldProcessorUsage = 0;
|
||||
ULONG OldProcessCount = 0;
|
||||
TCHAR szCpuUsage[256], szProcesses[256];
|
||||
WCHAR szCpuUsage[256], szProcesses[256];
|
||||
|
||||
/* Create the event */
|
||||
hProcessPageEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
|
||||
|
@ -516,7 +512,7 @@ DWORD WINAPI ProcessPageRefreshThread(void *lpParameter)
|
|||
return 0;
|
||||
|
||||
if (dwWaitVal == WAIT_OBJECT_0) {
|
||||
TCHAR text[260];
|
||||
WCHAR text[260];
|
||||
|
||||
/* Reset our event */
|
||||
ResetEvent(hProcessPageEvent);
|
||||
|
|
|
@ -27,43 +27,23 @@ void TaskManager_OnFileNew(void)
|
|||
{
|
||||
HMODULE hShell32;
|
||||
RUNFILEDLG RunFileDlg;
|
||||
TCHAR szTitle[40];
|
||||
TCHAR szText[256];
|
||||
WCHAR szTitle[40];
|
||||
WCHAR szText[256];
|
||||
|
||||
/* Load language strings from resource file */
|
||||
LoadString(hInst, IDS_CREATENEWTASK, szTitle, sizeof(szTitle) / sizeof(szTitle[0]));
|
||||
LoadString(hInst, IDS_CREATENEWTASK_DESC, szText, sizeof(szText) / sizeof(szText[0]));
|
||||
|
||||
|
||||
hShell32 = LoadLibrary(_T("SHELL32.DLL"));
|
||||
hShell32 = LoadLibrary(L"SHELL32.DLL");
|
||||
RunFileDlg = (RUNFILEDLG)(FARPROC)GetProcAddress(hShell32, (LPCSTR)0x3D);
|
||||
|
||||
/* Show "Run..." dialog */
|
||||
if (RunFileDlg)
|
||||
{
|
||||
#ifndef UNICODE
|
||||
if (GetVersion() < 0x80000000)
|
||||
{
|
||||
WCHAR wTitle[40];
|
||||
WCHAR wText[256];
|
||||
|
||||
/* RunFileDlg is always unicode on NT systems, convert the ansi
|
||||
strings to unicode */
|
||||
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szTitle, -1, wTitle, sizeof(szTitle) / sizeof(szTitle[0]));
|
||||
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szText, -1, wText, sizeof(szText) / sizeof(szText[0]));
|
||||
|
||||
RunFileDlg(hMainWnd, 0, NULL, wTitle, wText, RFF_CALCDIRECTORY);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* RunFileDlg is ansi on win 9x systems */
|
||||
RunFileDlg(hMainWnd, 0, NULL, (LPCWSTR)szTitle, (LPCWSTR)szText, RFF_CALCDIRECTORY);
|
||||
}
|
||||
#else
|
||||
/* NOTE - don't check whether running on win 9x or NT, let's just
|
||||
assume that a unicode build only runs on NT */
|
||||
RunFileDlg(hMainWnd, 0, NULL, szTitle, szText, RFF_CALCDIRECTORY);
|
||||
#endif
|
||||
}
|
||||
|
||||
FreeLibrary(hShell32);
|
||||
|
|
|
@ -43,9 +43,9 @@ BOOL bInMenuLoop = FALSE; /* Tells us if we are in the menu loop */
|
|||
TASKMANAGER_SETTINGS TaskManagerSettings;
|
||||
|
||||
|
||||
int APIENTRY WinMain(HINSTANCE hInstance,
|
||||
int APIENTRY wWinMain(HINSTANCE hInstance,
|
||||
HINSTANCE hPrevInstance,
|
||||
LPSTR lpCmdLine,
|
||||
LPWSTR lpCmdLine,
|
||||
int nCmdShow)
|
||||
{
|
||||
HANDLE hProcess;
|
||||
|
@ -423,7 +423,7 @@ BOOL OnCreate(HWND hWnd)
|
|||
int nActivePage;
|
||||
int nParts[3];
|
||||
RECT rc;
|
||||
TCHAR szTemp[256];
|
||||
WCHAR szTemp[256];
|
||||
TCITEM item;
|
||||
|
||||
SendMessage(hMainWnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(hInst, MAKEINTRESOURCE(IDI_TASKMANAGER)));
|
||||
|
@ -437,7 +437,7 @@ BOOL OnCreate(HWND hWnd)
|
|||
nMinimumHeight = (rc.bottom - rc.top);
|
||||
|
||||
/* Create the status bar */
|
||||
hStatusWnd = CreateStatusWindow(WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS|SBT_NOBORDERS, _T(""), hWnd, STATUS_WINDOW);
|
||||
hStatusWnd = CreateStatusWindow(WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS|SBT_NOBORDERS, L"", hWnd, STATUS_WINDOW);
|
||||
if(!hStatusWnd)
|
||||
return FALSE;
|
||||
|
||||
|
@ -669,7 +669,7 @@ void OnSize( WPARAM nType, int cx, int cy )
|
|||
void LoadSettings(void)
|
||||
{
|
||||
HKEY hKey;
|
||||
TCHAR szSubKey[] = _T("Software\\ReactWare\\TaskManager");
|
||||
WCHAR szSubKey[] = L"Software\\ReactWare\\TaskManager";
|
||||
int i;
|
||||
DWORD dwSize;
|
||||
|
||||
|
@ -718,7 +718,7 @@ void LoadSettings(void)
|
|||
return;
|
||||
/* Read the settings */
|
||||
dwSize = sizeof(TASKMANAGER_SETTINGS);
|
||||
RegQueryValueEx(hKey, _T("Preferences"), NULL, NULL, (LPBYTE)&TaskManagerSettings, &dwSize);
|
||||
RegQueryValueEx(hKey, L"Preferences", NULL, NULL, (LPBYTE)&TaskManagerSettings, &dwSize);
|
||||
|
||||
/*
|
||||
* ATM, the 'ImageName' column is always visible
|
||||
|
@ -734,9 +734,9 @@ void LoadSettings(void)
|
|||
void SaveSettings(void)
|
||||
{
|
||||
HKEY hKey;
|
||||
TCHAR szSubKey1[] = _T("Software");
|
||||
TCHAR szSubKey2[] = _T("Software\\ReactWare");
|
||||
TCHAR szSubKey3[] = _T("Software\\ReactWare\\TaskManager");
|
||||
WCHAR szSubKey1[] = L"Software";
|
||||
WCHAR szSubKey2[] = L"Software\\ReactWare";
|
||||
WCHAR szSubKey3[] = L"Software\\ReactWare\\TaskManager";
|
||||
|
||||
/* Open (or create) the key */
|
||||
hKey = NULL;
|
||||
|
@ -749,7 +749,7 @@ void SaveSettings(void)
|
|||
if (RegCreateKeyEx(HKEY_CURRENT_USER, szSubKey3, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS)
|
||||
return;
|
||||
/* Save the settings */
|
||||
RegSetValueEx(hKey, _T("Preferences"), 0, REG_BINARY, (LPBYTE)&TaskManagerSettings, sizeof(TASKMANAGER_SETTINGS));
|
||||
RegSetValueEx(hKey, L"Preferences", 0, REG_BINARY, (LPBYTE)&TaskManagerSettings, sizeof(TASKMANAGER_SETTINGS));
|
||||
/* Close the key */
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
|
@ -776,15 +776,15 @@ void TaskManager_OnEnterMenuLoop(HWND hWnd)
|
|||
nParts = -1;
|
||||
SendMessage(hStatusWnd, SB_SETPARTS, 1, (LPARAM) (LPINT)&nParts);
|
||||
bInMenuLoop = TRUE;
|
||||
SendMessage(hStatusWnd, SB_SETTEXT, (WPARAM)0, (LPARAM)_T(""));
|
||||
SendMessage(hStatusWnd, SB_SETTEXT, (WPARAM)0, (LPARAM)L"");
|
||||
}
|
||||
|
||||
void TaskManager_OnExitMenuLoop(HWND hWnd)
|
||||
{
|
||||
RECT rc;
|
||||
int nParts[3];
|
||||
TCHAR text[260];
|
||||
TCHAR szCpuUsage[256], szProcesses[256];
|
||||
WCHAR text[260];
|
||||
WCHAR szCpuUsage[256], szProcesses[256];
|
||||
|
||||
LoadString(hInst, IDS_STATUS_CPUUSAGE, szCpuUsage, 256);
|
||||
LoadString(hInst, IDS_STATUS_PROCESSES, szProcesses, 256);
|
||||
|
@ -796,7 +796,7 @@ void TaskManager_OnExitMenuLoop(HWND hWnd)
|
|||
nParts[1] = 210;
|
||||
nParts[2] = rc.right;
|
||||
SendMessage(hStatusWnd, SB_SETPARTS, 3, (LPARAM) (LPINT) nParts);
|
||||
SendMessage(hStatusWnd, SB_SETTEXT, 0, (LPARAM)_T(""));
|
||||
SendMessage(hStatusWnd, SB_SETTEXT, 0, (LPARAM)L"");
|
||||
wsprintf(text, szCpuUsage, PerfDataGetProcessorUsage());
|
||||
SendMessage(hStatusWnd, SB_SETTEXT, 1, (LPARAM)text);
|
||||
wsprintf(text, szProcesses, PerfDataGetProcessCount());
|
||||
|
@ -805,14 +805,14 @@ void TaskManager_OnExitMenuLoop(HWND hWnd)
|
|||
|
||||
void TaskManager_OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
|
||||
{
|
||||
TCHAR str[100];
|
||||
WCHAR str[100];
|
||||
|
||||
_tcscpy(str, TEXT(""));
|
||||
wcscpy(str, L"");
|
||||
if (LoadString(hInst, nItemID, str, 100)) {
|
||||
/* load appropriate string */
|
||||
LPTSTR lpsz = str;
|
||||
/* first newline terminates actual string */
|
||||
lpsz = _tcschr(lpsz, '\n');
|
||||
lpsz = wcschr(lpsz, '\n');
|
||||
if (lpsz != NULL)
|
||||
*lpsz = '\0';
|
||||
}
|
||||
|
@ -896,7 +896,7 @@ void TaskManager_OnTabWndSelChange(void)
|
|||
HMENU hOptionsMenu;
|
||||
HMENU hViewMenu;
|
||||
HMENU hSubMenu;
|
||||
TCHAR szTemp[256];
|
||||
WCHAR szTemp[256];
|
||||
|
||||
hMenu = GetMenu(hMainWnd);
|
||||
hViewMenu = GetSubMenu(hMenu, 2);
|
||||
|
@ -1024,10 +1024,10 @@ LPTSTR GetLastErrorText(LPTSTR lpszBuf, DWORD dwSize)
|
|||
|
||||
/* supplied buffer is not long enough */
|
||||
if (!dwRet || ( (long)dwSize < (long)dwRet+14)) {
|
||||
lpszBuf[0] = TEXT('\0');
|
||||
lpszBuf[0] = L'\0';
|
||||
} else {
|
||||
lpszTemp[lstrlen(lpszTemp)-2] = TEXT('\0'); /*remove cr and newline character */
|
||||
_stprintf(lpszBuf, TEXT("%s (0x%x)"), lpszTemp, (int)GetLastError());
|
||||
lpszTemp[lstrlen(lpszTemp)-2] = L'\0'; /*remove cr and newline character */
|
||||
wsprintf(lpszBuf, L"%s (0x%x)", lpszTemp, (int)GetLastError());
|
||||
}
|
||||
if (lpszTemp) {
|
||||
LocalFree((HLOCAL)lpszTemp);
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
|
||||
<module name="taskmgr" type="win32gui" installbase="system32" installname="taskmgr.exe">
|
||||
<module name="taskmgr" type="win32gui" installbase="system32" installname="taskmgr.exe" unicode="yes">
|
||||
<include base="taskmgr">.</include>
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<define name="UNICODE" />
|
||||
<define name="_UNICODE" />
|
||||
<library>msvcrt</library>
|
||||
<library>ntdll</library>
|
||||
<library>kernel32</library>
|
||||
|
|
|
@ -135,7 +135,7 @@ BOOL TrayIcon_ShellAddTrayIcon(void)
|
|||
NOTIFYICONDATA nid;
|
||||
HICON hIcon = NULL;
|
||||
BOOL bRetVal;
|
||||
TCHAR szMsg[256];
|
||||
WCHAR szMsg[256];
|
||||
|
||||
memset(&nid, 0, sizeof(NOTIFYICONDATA));
|
||||
|
||||
|
@ -183,7 +183,7 @@ BOOL TrayIcon_ShellUpdateTrayIcon(void)
|
|||
NOTIFYICONDATA nid;
|
||||
HICON hIcon = NULL;
|
||||
BOOL bRetVal;
|
||||
TCHAR szTemp[256];
|
||||
WCHAR szTemp[256];
|
||||
|
||||
memset(&nid, 0, sizeof(NOTIFYICONDATA));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue