mirror of
https://github.com/reactos/reactos.git
synced 2024-07-02 10:45:24 +00:00
Many more conversions to Unicode function and type names for taskmgr
svn path=/trunk/; revision=30297
This commit is contained in:
parent
4be92e3dad
commit
58df092425
|
@ -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;
|
||||
|
||||
|
|
|
@ -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; nCpu<sizeof(dwCpuTable) / sizeof(dwCpuTable[0]); nCpu++) {
|
||||
|
@ -106,7 +106,7 @@ AffinityDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
* has affinity with
|
||||
*/
|
||||
if (dwProcessAffinityMask & (1 << nCpu))
|
||||
SendMessage(GetDlgItem(hDlg, dwCpuTable[nCpu]), BM_SETCHECK, BST_CHECKED, 0);
|
||||
SendMessageW(GetDlgItem(hDlg, dwCpuTable[nCpu]), BM_SETCHECK, BST_CHECKED, 0);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -132,7 +132,7 @@ AffinityDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
* First we have to create a mask out of each
|
||||
* checkbox that the user checked.
|
||||
*/
|
||||
if (SendMessage(GetDlgItem(hDlg, dwCpuTable[nCpu]), BM_GETCHECK, 0, 0))
|
||||
if (SendMessageW(GetDlgItem(hDlg, dwCpuTable[nCpu]), BM_GETCHECK, 0, 0))
|
||||
dwProcessAffinityMask |= (1 << nCpu);
|
||||
}
|
||||
|
||||
|
@ -143,9 +143,9 @@ 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(WCHAR));
|
||||
LoadString(hInst, IDS_MSG_INVALIDOPTION, szTempA, sizeof(szTempA) / sizeof(WCHAR));
|
||||
MessageBox(hDlg, szTemp, szTempA, MB_OK|MB_ICONSTOP);
|
||||
LoadStringW(hInst, IDS_MSG_PROCESSONEPRO, szTemp, sizeof(szTemp) / sizeof(WCHAR));
|
||||
LoadStringW(hInst, IDS_MSG_INVALIDOPTION, szTempA, sizeof(szTempA) / sizeof(WCHAR));
|
||||
MessageBoxW(hDlg, szTemp, szTempA, MB_OK|MB_ICONSTOP);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -155,8 +155,8 @@ AffinityDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
if (!SetProcessAffinityMask(hProcessAffinityHandle, dwProcessAffinityMask)) {
|
||||
GetLastErrorText(strErrorText, sizeof(strErrorText) / sizeof(WCHAR));
|
||||
EndDialog(hDlg, LOWORD(wParam));
|
||||
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);
|
||||
}
|
||||
|
||||
EndDialog(hDlg, LOWORD(wParam));
|
||||
|
|
|
@ -85,17 +85,17 @@ ApplicationPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
hApplicationPageSwitchToButton = GetDlgItem(hDlg, IDC_SWITCHTO);
|
||||
hApplicationPageNewTaskButton = GetDlgItem(hDlg, IDC_NEWTASK);
|
||||
|
||||
SetWindowText(hApplicationPageListCtrl, L"Tasks");
|
||||
SetWindowTextW(hApplicationPageListCtrl, L"Tasks");
|
||||
|
||||
/* Initialize the application page's controls */
|
||||
column.mask = LVCF_TEXT|LVCF_WIDTH;
|
||||
|
||||
LoadString(hInst, IDS_TAB_TASK, szTemp, 256);
|
||||
LoadStringW(hInst, IDS_TAB_TASK, szTemp, 256);
|
||||
column.pszText = szTemp;
|
||||
column.cx = 250;
|
||||
(void)ListView_InsertColumn(hApplicationPageListCtrl, 0, &column); /* Add the "Task" column */
|
||||
column.mask = LVCF_TEXT|LVCF_WIDTH;
|
||||
LoadString(hInst, IDS_TAB_STATUS, szTemp, 256);
|
||||
LoadStringW(hInst, IDS_TAB_STATUS, szTemp, 256);
|
||||
column.pszText = szTemp;
|
||||
column.cx = 95;
|
||||
(void)ListView_InsertColumn(hApplicationPageListCtrl, 1, &column); /* Add the "Status" column */
|
||||
|
@ -129,7 +129,7 @@ ApplicationPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
ApplicationPage_OnSwitchTo();
|
||||
break;
|
||||
case IDC_NEWTASK:
|
||||
SendMessage(hMainWnd, WM_COMMAND, MAKEWPARAM(ID_FILE_NEW, 0), 0);
|
||||
SendMessageW(hMainWnd, WM_COMMAND, MAKEWPARAM(ID_FILE_NEW, 0), 0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ void RefreshApplicationPage(void)
|
|||
|
||||
void UpdateApplicationListControlViewSetting(void)
|
||||
{
|
||||
DWORD dwStyle = GetWindowLong(hApplicationPageListCtrl, GWL_STYLE);
|
||||
DWORD dwStyle = GetWindowLongW(hApplicationPageListCtrl, GWL_STYLE);
|
||||
|
||||
dwStyle &= ~LVS_REPORT;
|
||||
dwStyle &= ~LVS_ICON;
|
||||
|
@ -208,7 +208,7 @@ void UpdateApplicationListControlViewSetting(void)
|
|||
else
|
||||
dwStyle |= LVS_REPORT;
|
||||
|
||||
SetWindowLong(hApplicationPageListCtrl, GWL_STYLE, dwStyle);
|
||||
SetWindowLongW(hApplicationPageListCtrl, GWL_STYLE, dwStyle);
|
||||
|
||||
RefreshApplicationPage();
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ void UpdateApplicationListControlViewSetting(void)
|
|||
DWORD WINAPI ApplicationPageRefreshThread(void *lpParameter)
|
||||
{
|
||||
/* Create the event */
|
||||
hApplicationPageEvent = CreateEvent(NULL, TRUE, TRUE, NULL);
|
||||
hApplicationPageEvent = CreateEventW(NULL, TRUE, TRUE, NULL);
|
||||
|
||||
/* If we couldn't create the event then exit the thread */
|
||||
if (!hApplicationPageEvent)
|
||||
|
@ -267,36 +267,36 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam)
|
|||
|
||||
bLargeIcon = TaskManagerSettings.View_LargeIcons ? TRUE : FALSE;
|
||||
|
||||
GetWindowText(hWnd, szText, 260); /* Get the window text */
|
||||
GetWindowTextW(hWnd, szText, 260); /* Get the window text */
|
||||
|
||||
/* Check and see if this is a top-level app window */
|
||||
if ((wcslen(szText) <= 0) ||
|
||||
!IsWindowVisible(hWnd) ||
|
||||
(GetParent(hWnd) != NULL) ||
|
||||
(GetWindow(hWnd, GW_OWNER) != NULL) ||
|
||||
(GetWindowLong(hWnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW))
|
||||
(GetWindowLongW(hWnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW))
|
||||
{
|
||||
return TRUE; /* Skip this window */
|
||||
}
|
||||
|
||||
/* Get the icon for this window */
|
||||
hIcon = NULL;
|
||||
SendMessageTimeout(hWnd, WM_GETICON,bLargeIcon ? ICON_BIG /*1*/ : ICON_SMALL /*0*/, 0, 0, 1000, (PDWORD_PTR)xhIcon);
|
||||
SendMessageTimeoutW(hWnd, WM_GETICON,bLargeIcon ? ICON_BIG /*1*/ : ICON_SMALL /*0*/, 0, 0, 1000, (PDWORD_PTR)xhIcon);
|
||||
|
||||
if (!hIcon)
|
||||
{
|
||||
hIcon = (HICON)(LONG_PTR)GetClassLongPtr(hWnd, bLargeIcon ? GCL_HICON : GCL_HICONSM);
|
||||
if (!hIcon) hIcon = (HICON)(LONG_PTR)GetClassLongPtr(hWnd, bLargeIcon ? GCL_HICONSM : GCL_HICON);
|
||||
if (!hIcon) SendMessageTimeout(hWnd, WM_QUERYDRAGICON, 0, 0, 0, 1000, (PDWORD_PTR)xhIcon);
|
||||
if (!hIcon) SendMessageTimeout(hWnd, WM_GETICON, bLargeIcon ? ICON_SMALL /*0*/ : ICON_BIG /*1*/, 0, 0, 1000, (PDWORD_PTR)xhIcon);
|
||||
hIcon = (HICON)(LONG_PTR)GetClassLongPtrW(hWnd, bLargeIcon ? GCL_HICON : GCL_HICONSM);
|
||||
if (!hIcon) hIcon = (HICON)(LONG_PTR)GetClassLongPtrW(hWnd, bLargeIcon ? GCL_HICONSM : GCL_HICON);
|
||||
if (!hIcon) SendMessageTimeoutW(hWnd, WM_QUERYDRAGICON, 0, 0, 0, 1000, (PDWORD_PTR)xhIcon);
|
||||
if (!hIcon) SendMessageTimeoutW(hWnd, WM_GETICON, bLargeIcon ? ICON_SMALL /*0*/ : ICON_BIG /*1*/, 0, 0, 1000, (PDWORD_PTR)xhIcon);
|
||||
}
|
||||
|
||||
if (!hIcon)
|
||||
hIcon = LoadIcon(hInst, bLargeIcon ? MAKEINTRESOURCE(IDI_WINDOW) : MAKEINTRESOURCE(IDI_WINDOWSM));
|
||||
hIcon = LoadIconW(hInst, bLargeIcon ? MAKEINTRESOURCEW(IDI_WINDOW) : MAKEINTRESOURCEW(IDI_WINDOWSM));
|
||||
|
||||
bHung = FALSE;
|
||||
|
||||
IsHungAppWindow = (IsHungAppWindowProc)(FARPROC)GetProcAddress(GetModuleHandle(L"USER32.DLL"), "IsHungAppWindow");
|
||||
IsHungAppWindow = (IsHungAppWindowProc)(FARPROC)GetProcAddress(GetModuleHandleW(L"USER32.DLL"), "IsHungAppWindow");
|
||||
|
||||
if (IsHungAppWindow)
|
||||
bHung = IsHungAppWindow(hWnd);
|
||||
|
@ -343,7 +343,7 @@ void AddOrUpdateHwnd(HWND hWnd, WCHAR *szTitle, HICON hIcon, BOOL bHung)
|
|||
{
|
||||
/* Check to see if anything needs updating */
|
||||
if ((pAPLI->hIcon != 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<COLUMN_NMAX; n++) {
|
||||
if (TaskManagerSettings.Columns[n]) {
|
||||
LoadString(hInst, ColumnPresets[n].dwIdsName, szTemp, sizeof(szTemp)/sizeof(WCHAR));
|
||||
LoadStringW(hInst, ColumnPresets[n].dwIdsName, szTemp, sizeof(szTemp)/sizeof(WCHAR));
|
||||
InsertColumn(n, szTemp, LVCFMT_LEFT, TaskManagerSettings.ColumnSizeArray[n], -1);
|
||||
}
|
||||
}
|
||||
|
||||
size = SendMessage(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0);
|
||||
SendMessage(hProcessPageHeaderCtrl, HDM_SETORDERARRAY, (WPARAM) size, (LPARAM) &TaskManagerSettings.ColumnOrderArray);
|
||||
size = SendMessageW(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0);
|
||||
SendMessageW(hProcessPageHeaderCtrl, HDM_SETORDERARRAY, (WPARAM) size, (LPARAM) &TaskManagerSettings.ColumnOrderArray);
|
||||
|
||||
UpdateColumnDataHints();
|
||||
}
|
||||
|
||||
int InsertColumn(int nCol, LPCTSTR lpszColumnHeading, int nFormat, int nWidth, int nSubItem)
|
||||
int InsertColumn(int nCol, LPCWSTR lpszColumnHeading, int nFormat, int nWidth, int nSubItem)
|
||||
{
|
||||
LVCOLUMN column;
|
||||
|
||||
column.mask = LVCF_TEXT|LVCF_FMT;
|
||||
column.pszText = (LPTSTR)lpszColumnHeading;
|
||||
column.pszText = (LPWSTR)lpszColumnHeading;
|
||||
column.fmt = nFormat;
|
||||
|
||||
if (nWidth != -1)
|
||||
|
@ -117,22 +117,22 @@ void SaveColumnSettings(void)
|
|||
}
|
||||
|
||||
/* Get header order */
|
||||
size = SendMessage(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0);
|
||||
SendMessage(hProcessPageHeaderCtrl, HDM_GETORDERARRAY, (WPARAM) size, (LPARAM) &TaskManagerSettings.ColumnOrderArray);
|
||||
size = SendMessageW(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0);
|
||||
SendMessageW(hProcessPageHeaderCtrl, HDM_GETORDERARRAY, (WPARAM) size, (LPARAM) &TaskManagerSettings.ColumnOrderArray);
|
||||
|
||||
/* Get visible columns */
|
||||
for (i=0; i<SendMessage(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0); i++) {
|
||||
for (i=0; i<SendMessageW(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0); i++) {
|
||||
memset(&hditem, 0, sizeof(HDITEM));
|
||||
|
||||
hditem.mask = HDI_TEXT|HDI_WIDTH;
|
||||
hditem.pszText = text;
|
||||
hditem.cchTextMax = 260;
|
||||
|
||||
SendMessage(hProcessPageHeaderCtrl, HDM_GETITEM, i, (LPARAM) &hditem);
|
||||
SendMessageW(hProcessPageHeaderCtrl, HDM_GETITEM, i, (LPARAM) &hditem);
|
||||
|
||||
for (n=0; n<COLUMN_NMAX; n++) {
|
||||
LoadString(hInst, ColumnPresets[n].dwIdsName, szTemp, sizeof(szTemp)/sizeof(WCHAR));
|
||||
if (wcsicmp(text, szTemp) == 0)
|
||||
LoadStringW(hInst, ColumnPresets[n].dwIdsName, szTemp, sizeof(szTemp)/sizeof(WCHAR));
|
||||
if (_wcsicmp(text, szTemp) == 0)
|
||||
{
|
||||
TaskManagerSettings.Columns[n] = TRUE;
|
||||
TaskManagerSettings.ColumnSizeArray[n] = hditem.cxy;
|
||||
|
@ -145,7 +145,7 @@ void ProcessPage_OnViewSelectColumns(void)
|
|||
{
|
||||
int i;
|
||||
|
||||
if (DialogBox(hInst, MAKEINTRESOURCE(IDD_COLUMNS_DIALOG), hMainWnd, ColumnsDialogWndProc) == IDOK)
|
||||
if (DialogBoxW(hInst, MAKEINTRESOURCEW(IDD_COLUMNS_DIALOG), hMainWnd, ColumnsDialogWndProc) == IDOK)
|
||||
{
|
||||
for (i=Header_GetItemCount(hProcessPageHeaderCtrl)-1; i>=0; i--)
|
||||
{
|
||||
|
@ -172,7 +172,7 @@ ColumnsDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
for (i=0; i<COLUMN_NMAX; i++) {
|
||||
if (TaskManagerSettings.Columns[i])
|
||||
SendMessage(GetDlgItem(hDlg, ColumnPresets[i].dwIdcCtrl), BM_SETCHECK, BST_CHECKED, 0);
|
||||
SendMessageW(GetDlgItem(hDlg, ColumnPresets[i].dwIdcCtrl), BM_SETCHECK, BST_CHECKED, 0);
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
|
@ -187,7 +187,7 @@ ColumnsDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
if (LOWORD(wParam) == IDOK)
|
||||
{
|
||||
for (i=0; i<COLUMN_NMAX; i++)
|
||||
TaskManagerSettings.Columns[i] = (BOOL) SendMessage(GetDlgItem(hDlg, ColumnPresets[i].dwIdcCtrl), BM_GETCHECK, 0, 0);
|
||||
TaskManagerSettings.Columns[i] = (BOOL) SendMessageW(GetDlgItem(hDlg, ColumnPresets[i].dwIdcCtrl), BM_GETCHECK, 0, 0);
|
||||
|
||||
EndDialog(hDlg, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
@ -207,7 +207,7 @@ void UpdateColumnDataHints(void)
|
|||
WCHAR szTemp[256];
|
||||
unsigned int i;
|
||||
|
||||
for (Index=0; Index<(ULONG)SendMessage(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0); Index++)
|
||||
for (Index=0; Index<(ULONG)SendMessageW(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0); Index++)
|
||||
{
|
||||
memset(&hditem, 0, sizeof(HDITEM));
|
||||
|
||||
|
@ -215,11 +215,11 @@ void UpdateColumnDataHints(void)
|
|||
hditem.pszText = text;
|
||||
hditem.cchTextMax = 260;
|
||||
|
||||
SendMessage(hProcessPageHeaderCtrl, HDM_GETITEM, Index, (LPARAM) &hditem);
|
||||
SendMessageW(hProcessPageHeaderCtrl, HDM_GETITEM, Index, (LPARAM) &hditem);
|
||||
|
||||
for (i=0; i<COLUMN_NMAX; i++) {
|
||||
LoadString(hInst, ColumnPresets[i].dwIdsName, szTemp, sizeof(szTemp)/sizeof(WCHAR));
|
||||
if (wcsicmp(text, szTemp) == 0)
|
||||
LoadStringW(hInst, ColumnPresets[i].dwIdsName, szTemp, sizeof(szTemp)/sizeof(WCHAR));
|
||||
if (_wcsicmp(text, szTemp) == 0)
|
||||
ColumnDataHints[Index] = i;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ static int list_channel_CB(HANDLE hProcess, void* addr, WCHAR* buffer, void*
|
|||
|
||||
struct cce_user
|
||||
{
|
||||
LPCTSTR name; /* channel to look for */
|
||||
LPCWSTR name; /* channel to look for */
|
||||
unsigned value, mask; /* how to change channel */
|
||||
unsigned done; /* number of successful changes */
|
||||
unsigned notdone; /* number of unsuccessful changes */
|
||||
|
@ -292,9 +292,9 @@ static void DebugChannels_FillList(HWND hChannelLV)
|
|||
|
||||
hProcess = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_READ, FALSE, get_selected_pid());
|
||||
if (!hProcess) return; /* FIXME messagebox */
|
||||
SendMessage(hChannelLV, WM_SETREDRAW, FALSE, 0);
|
||||
SendMessageW(hChannelLV, WM_SETREDRAW, FALSE, 0);
|
||||
enum_channel(hProcess, list_channel_CB, (void*)hChannelLV, TRUE);
|
||||
SendMessage(hChannelLV, WM_SETREDRAW, TRUE, 0);
|
||||
SendMessageW(hChannelLV, WM_SETREDRAW, TRUE, 0);
|
||||
CloseHandle(hProcess);
|
||||
}
|
||||
|
||||
|
@ -354,7 +354,7 @@ static void DebugChannels_OnNotify(HWND hDlg, LPARAM lParam)
|
|||
if (!hProcess) return; /* FIXME message box */
|
||||
lhti.pt = nmia->ptAction;
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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<wcslen(strDebugger); Idx++)
|
||||
strDebugger[Idx] = toupper(strDebugger[Idx]);
|
||||
|
@ -491,14 +491,14 @@ DWORD WINAPI ProcessPageRefreshThread(void *lpParameter)
|
|||
WCHAR szCpuUsage[256], szProcesses[256];
|
||||
|
||||
/* 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 (!hProcessPageEvent)
|
||||
return 0;
|
||||
|
||||
LoadString(hInst, IDS_STATUS_CPUUSAGE, szCpuUsage, 256);
|
||||
LoadString(hInst, IDS_STATUS_PROCESSES, szProcesses, 256);
|
||||
LoadStringW(hInst, IDS_STATUS_CPUUSAGE, szCpuUsage, 256);
|
||||
LoadStringW(hInst, IDS_STATUS_PROCESSES, szProcesses, 256);
|
||||
|
||||
while (1) {
|
||||
DWORD dwWaitVal;
|
||||
|
@ -517,21 +517,21 @@ DWORD WINAPI ProcessPageRefreshThread(void *lpParameter)
|
|||
/* Reset our event */
|
||||
ResetEvent(hProcessPageEvent);
|
||||
|
||||
if ((ULONG)SendMessage(hProcessPageListCtrl, LVM_GETITEMCOUNT, 0, 0) != PerfDataGetProcessCount())
|
||||
SendMessage(hProcessPageListCtrl, LVM_SETITEMCOUNT, PerfDataGetProcessCount(), /*LVSICF_NOINVALIDATEALL|*/LVSICF_NOSCROLL);
|
||||
if ((ULONG)SendMessageW(hProcessPageListCtrl, LVM_GETITEMCOUNT, 0, 0) != PerfDataGetProcessCount())
|
||||
SendMessageW(hProcessPageListCtrl, LVM_SETITEMCOUNT, PerfDataGetProcessCount(), /*LVSICF_NOINVALIDATEALL|*/LVSICF_NOSCROLL);
|
||||
|
||||
if (IsWindowVisible(hProcessPage))
|
||||
InvalidateRect(hProcessPageListCtrl, NULL, FALSE);
|
||||
|
||||
if (OldProcessorUsage != PerfDataGetProcessorUsage()) {
|
||||
OldProcessorUsage = PerfDataGetProcessorUsage();
|
||||
wsprintf(text, szCpuUsage, OldProcessorUsage);
|
||||
SendMessage(hStatusWnd, SB_SETTEXT, 1, (LPARAM)text);
|
||||
wsprintfW(text, szCpuUsage, OldProcessorUsage);
|
||||
SendMessageW(hStatusWnd, SB_SETTEXT, 1, (LPARAM)text);
|
||||
}
|
||||
if (OldProcessCount != PerfDataGetProcessCount()) {
|
||||
OldProcessCount = PerfDataGetProcessCount();
|
||||
wsprintf(text, szProcesses, OldProcessCount);
|
||||
SendMessage(hStatusWnd, SB_SETTEXT, 0, (LPARAM)text);
|
||||
wsprintfW(text, szProcesses, OldProcessCount);
|
||||
SendMessageW(hStatusWnd, SB_SETTEXT, 0, (LPARAM)text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,11 +31,11 @@ void TaskManager_OnFileNew(void)
|
|||
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]));
|
||||
LoadStringW(hInst, IDS_CREATENEWTASK, szTitle, sizeof(szTitle) / sizeof(szTitle[0]));
|
||||
LoadStringW(hInst, IDS_CREATENEWTASK_DESC, szText, sizeof(szText) / sizeof(szText[0]));
|
||||
|
||||
|
||||
hShell32 = LoadLibrary(L"SHELL32.DLL");
|
||||
hShell32 = LoadLibraryW(L"SHELL32.DLL");
|
||||
RunFileDlg = (RUNFILEDLG)(FARPROC)GetProcAddress(hShell32, (LPCSTR)0x3D);
|
||||
|
||||
/* Show "Run..." dialog */
|
||||
|
|
|
@ -67,7 +67,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
|
|||
/* Get a token for this process. */
|
||||
if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) {
|
||||
/* Get the LUID for the debug privilege. */
|
||||
LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &tkp.Privileges[0].Luid);
|
||||
LookupPrivilegeValueW(NULL, SE_DEBUG_NAME, &tkp.Privileges[0].Luid);
|
||||
|
||||
tkp.PrivilegeCount = 1; /* one privilege to set */
|
||||
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
|
||||
|
@ -85,7 +85,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
|
|||
return -1;
|
||||
}
|
||||
|
||||
DialogBox(hInst, (LPCTSTR)IDD_TASKMGR_DIALOG, NULL, TaskManagerWndProc);
|
||||
DialogBoxW(hInst, (LPCWSTR)IDD_TASKMGR_DIALOG, NULL, TaskManagerWndProc);
|
||||
|
||||
/* Save our settings to the registry */
|
||||
SaveSettings();
|
||||
|
@ -170,7 +170,7 @@ TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
ProcessPage_OnViewSelectColumns();
|
||||
break;
|
||||
case ID_VIEW_REFRESH:
|
||||
PostMessage(hDlg, WM_TIMER, 0, 0);
|
||||
PostMessageW(hDlg, WM_TIMER, 0, 0);
|
||||
break;
|
||||
case ID_WINDOWS_TILEHORIZONTALLY:
|
||||
ApplicationPage_OnWindowsTileHorizontally();
|
||||
|
@ -252,9 +252,9 @@ TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
GetCursorPos(&pt);
|
||||
|
||||
OnTop = ((GetWindowLong(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0);
|
||||
OnTop = ((GetWindowLongW(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0);
|
||||
|
||||
hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_TRAY_POPUP));
|
||||
hMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_TRAY_POPUP));
|
||||
hPopupMenu = GetSubMenu(hMenu, 0);
|
||||
|
||||
if(IsWindowVisible(hMainWnd))
|
||||
|
@ -356,7 +356,7 @@ TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
TaskManagerSettings.Maximized = TRUE;
|
||||
else
|
||||
TaskManagerSettings.Maximized = FALSE;
|
||||
return DefWindowProc(hDlg, message, wParam, lParam);
|
||||
return DefWindowProcW(hDlg, message, wParam, lParam);
|
||||
|
||||
case WM_TIMER:
|
||||
/* Refresh the performance data */
|
||||
|
@ -384,7 +384,7 @@ TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
void FillSolidRect(HDC hDC, LPCRECT lpRect, COLORREF clr)
|
||||
{
|
||||
SetBkColor(hDC, clr);
|
||||
ExtTextOut(hDC, 0, 0, ETO_OPAQUE, lpRect, NULL, 0, NULL);
|
||||
ExtTextOutW(hDC, 0, 0, ETO_OPAQUE, lpRect, NULL, 0, NULL);
|
||||
}
|
||||
|
||||
void FillSolidRect2(HDC hDC, int x, int y, int cx, int cy, COLORREF clr)
|
||||
|
@ -396,7 +396,7 @@ void FillSolidRect2(HDC hDC, int x, int y, int cx, int cy, COLORREF clr)
|
|||
rect.top = y;
|
||||
rect.right = x + cx;
|
||||
rect.bottom = y + cy;
|
||||
ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL);
|
||||
ExtTextOutW(hDC, 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL);
|
||||
}
|
||||
|
||||
void Draw3dRect(HDC hDC, int x, int y, int cx, int cy, COLORREF clrTopLeft, COLORREF clrBottomRight)
|
||||
|
@ -426,7 +426,7 @@ BOOL OnCreate(HWND hWnd)
|
|||
WCHAR szTemp[256];
|
||||
TCITEM item;
|
||||
|
||||
SendMessage(hMainWnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(hInst, MAKEINTRESOURCE(IDI_TASKMANAGER)));
|
||||
SendMessageW(hMainWnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIconW(hInst, MAKEINTRESOURCEW(IDI_TASKMANAGER)));
|
||||
|
||||
/* Initialize the Windows Common Controls DLL */
|
||||
InitCommonControls();
|
||||
|
@ -445,32 +445,32 @@ BOOL OnCreate(HWND hWnd)
|
|||
nParts[0] = 100;
|
||||
nParts[1] = 210;
|
||||
nParts[2] = 400;
|
||||
SendMessage(hStatusWnd, SB_SETPARTS, 3, (LPARAM) (LPINT) nParts);
|
||||
SendMessageW(hStatusWnd, SB_SETPARTS, 3, (LPARAM) (LPINT) nParts);
|
||||
|
||||
/* Create tab pages */
|
||||
hTabWnd = GetDlgItem(hWnd, IDC_TAB);
|
||||
#if 1
|
||||
hApplicationPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_APPLICATION_PAGE), hWnd, ApplicationPageWndProc);
|
||||
hProcessPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_PROCESS_PAGE), hWnd, ProcessPageWndProc);
|
||||
hPerformancePage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_PERFORMANCE_PAGE), hWnd, PerformancePageWndProc);
|
||||
hApplicationPage = CreateDialogW(hInst, MAKEINTRESOURCEW(IDD_APPLICATION_PAGE), hWnd, ApplicationPageWndProc);
|
||||
hProcessPage = CreateDialogW(hInst, MAKEINTRESOURCEW(IDD_PROCESS_PAGE), hWnd, ProcessPageWndProc);
|
||||
hPerformancePage = CreateDialogW(hInst, MAKEINTRESOURCEW(IDD_PERFORMANCE_PAGE), hWnd, PerformancePageWndProc);
|
||||
#else
|
||||
hApplicationPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_APPLICATION_PAGE), hTabWnd, ApplicationPageWndProc);
|
||||
hProcessPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_PROCESS_PAGE), hTabWnd, ProcessPageWndProc);
|
||||
hPerformancePage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_PERFORMANCE_PAGE), hTabWnd, PerformancePageWndProc);
|
||||
hApplicationPage = CreateDialogW(hInst, MAKEINTRESOURCEW(IDD_APPLICATION_PAGE), hTabWnd, ApplicationPageWndProc);
|
||||
hProcessPage = CreateDialogW(hInst, MAKEINTRESOURCEW(IDD_PROCESS_PAGE), hTabWnd, ProcessPageWndProc);
|
||||
hPerformancePage = CreateDialogW(hInst, MAKEINTRESOURCEW(IDD_PERFORMANCE_PAGE), hTabWnd, PerformancePageWndProc);
|
||||
#endif
|
||||
|
||||
/* Insert tabs */
|
||||
LoadString(hInst, IDS_TAB_APPS, szTemp, 256);
|
||||
LoadStringW(hInst, IDS_TAB_APPS, szTemp, 256);
|
||||
memset(&item, 0, sizeof(TCITEM));
|
||||
item.mask = TCIF_TEXT;
|
||||
item.pszText = szTemp;
|
||||
(void)TabCtrl_InsertItem(hTabWnd, 0, &item);
|
||||
LoadString(hInst, IDS_TAB_PROCESSES, szTemp, 256);
|
||||
LoadStringW(hInst, IDS_TAB_PROCESSES, szTemp, 256);
|
||||
memset(&item, 0, sizeof(TCITEM));
|
||||
item.mask = TCIF_TEXT;
|
||||
item.pszText = szTemp;
|
||||
(void)TabCtrl_InsertItem(hTabWnd, 1, &item);
|
||||
LoadString(hInst, IDS_TAB_PERFORMANCE, szTemp, 256);
|
||||
LoadStringW(hInst, IDS_TAB_PERFORMANCE, szTemp, 256);
|
||||
memset(&item, 0, sizeof(TCITEM));
|
||||
item.mask = TCIF_TEXT;
|
||||
item.pszText = szTemp;
|
||||
|
@ -633,13 +633,13 @@ void OnSize( WPARAM nType, int cx, int cy )
|
|||
|
||||
/* Update the status bar size */
|
||||
GetWindowRect(hStatusWnd, &rc);
|
||||
SendMessage(hStatusWnd, WM_SIZE, nType, MAKELPARAM(cx, cy + (rc.bottom - rc.top)));
|
||||
SendMessageW(hStatusWnd, WM_SIZE, nType, MAKELPARAM(cx, cy + (rc.bottom - rc.top)));
|
||||
|
||||
/* Update the status bar pane sizes */
|
||||
nParts[0] = bInMenuLoop ? -1 : 100;
|
||||
nParts[1] = 210;
|
||||
nParts[2] = cx;
|
||||
SendMessage(hStatusWnd, SB_SETPARTS, bInMenuLoop ? 1 : 3, (LPARAM) (LPINT) nParts);
|
||||
SendMessageW(hStatusWnd, SB_SETPARTS, bInMenuLoop ? 1 : 3, (LPARAM) (LPINT) nParts);
|
||||
|
||||
/* Resize the tab control */
|
||||
GetWindowRect(hTabWnd, &rc);
|
||||
|
@ -714,11 +714,11 @@ void LoadSettings(void)
|
|||
TaskManagerSettings.ShowKernelTimes = FALSE;
|
||||
|
||||
/* Open the key */
|
||||
if (RegOpenKeyEx(HKEY_CURRENT_USER, szSubKey, 0, KEY_READ, &hKey) != ERROR_SUCCESS)
|
||||
if (RegOpenKeyExW(HKEY_CURRENT_USER, szSubKey, 0, KEY_READ, &hKey) != ERROR_SUCCESS)
|
||||
return;
|
||||
/* Read the settings */
|
||||
dwSize = sizeof(TASKMANAGER_SETTINGS);
|
||||
RegQueryValueEx(hKey, L"Preferences", NULL, NULL, (LPBYTE)&TaskManagerSettings, &dwSize);
|
||||
RegQueryValueExW(hKey, L"Preferences", NULL, NULL, (LPBYTE)&TaskManagerSettings, &dwSize);
|
||||
|
||||
/*
|
||||
* ATM, the 'ImageName' column is always visible
|
||||
|
@ -740,16 +740,16 @@ void SaveSettings(void)
|
|||
|
||||
/* Open (or create) the key */
|
||||
hKey = NULL;
|
||||
RegCreateKeyEx(HKEY_CURRENT_USER, szSubKey1, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL);
|
||||
RegCreateKeyExW(HKEY_CURRENT_USER, szSubKey1, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL);
|
||||
RegCloseKey(hKey);
|
||||
hKey = NULL;
|
||||
RegCreateKeyEx(HKEY_CURRENT_USER, szSubKey2, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL);
|
||||
RegCreateKeyExW(HKEY_CURRENT_USER, szSubKey2, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL);
|
||||
RegCloseKey(hKey);
|
||||
hKey = NULL;
|
||||
if (RegCreateKeyEx(HKEY_CURRENT_USER, szSubKey3, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS)
|
||||
if (RegCreateKeyExW(HKEY_CURRENT_USER, szSubKey3, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS)
|
||||
return;
|
||||
/* Save the settings */
|
||||
RegSetValueEx(hKey, L"Preferences", 0, REG_BINARY, (LPBYTE)&TaskManagerSettings, sizeof(TASKMANAGER_SETTINGS));
|
||||
RegSetValueExW(hKey, L"Preferences", 0, REG_BINARY, (LPBYTE)&TaskManagerSettings, sizeof(TASKMANAGER_SETTINGS));
|
||||
/* Close the key */
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
|
@ -761,7 +761,7 @@ void TaskManager_OnRestoreMainWindow(void)
|
|||
|
||||
hMenu = GetMenu(hMainWnd);
|
||||
hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
|
||||
OnTop = ((GetWindowLong(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0);
|
||||
OnTop = ((GetWindowLongW(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0);
|
||||
|
||||
OpenIcon(hMainWnd);
|
||||
SetForegroundWindow(hMainWnd);
|
||||
|
@ -774,9 +774,9 @@ void TaskManager_OnEnterMenuLoop(HWND hWnd)
|
|||
|
||||
/* Update the status bar pane sizes */
|
||||
nParts = -1;
|
||||
SendMessage(hStatusWnd, SB_SETPARTS, 1, (LPARAM) (LPINT)&nParts);
|
||||
SendMessageW(hStatusWnd, SB_SETPARTS, 1, (LPARAM) (LPINT)&nParts);
|
||||
bInMenuLoop = TRUE;
|
||||
SendMessage(hStatusWnd, SB_SETTEXT, (WPARAM)0, (LPARAM)L"");
|
||||
SendMessageW(hStatusWnd, SB_SETTEXT, (WPARAM)0, (LPARAM)L"");
|
||||
}
|
||||
|
||||
void TaskManager_OnExitMenuLoop(HWND hWnd)
|
||||
|
@ -786,8 +786,8 @@ void TaskManager_OnExitMenuLoop(HWND hWnd)
|
|||
WCHAR text[260];
|
||||
WCHAR szCpuUsage[256], szProcesses[256];
|
||||
|
||||
LoadString(hInst, IDS_STATUS_CPUUSAGE, szCpuUsage, 256);
|
||||
LoadString(hInst, IDS_STATUS_PROCESSES, szProcesses, 256);
|
||||
LoadStringW(hInst, IDS_STATUS_CPUUSAGE, szCpuUsage, 256);
|
||||
LoadStringW(hInst, IDS_STATUS_PROCESSES, szProcesses, 256);
|
||||
|
||||
bInMenuLoop = FALSE;
|
||||
/* Update the status bar pane sizes */
|
||||
|
@ -795,12 +795,12 @@ void TaskManager_OnExitMenuLoop(HWND hWnd)
|
|||
nParts[0] = 100;
|
||||
nParts[1] = 210;
|
||||
nParts[2] = rc.right;
|
||||
SendMessage(hStatusWnd, SB_SETPARTS, 3, (LPARAM) (LPINT) nParts);
|
||||
SendMessage(hStatusWnd, SB_SETTEXT, 0, (LPARAM)L"");
|
||||
wsprintf(text, szCpuUsage, PerfDataGetProcessorUsage());
|
||||
SendMessage(hStatusWnd, SB_SETTEXT, 1, (LPARAM)text);
|
||||
wsprintf(text, szProcesses, PerfDataGetProcessCount());
|
||||
SendMessage(hStatusWnd, SB_SETTEXT, 0, (LPARAM)text);
|
||||
SendMessageW(hStatusWnd, SB_SETPARTS, 3, (LPARAM) (LPINT) nParts);
|
||||
SendMessageW(hStatusWnd, SB_SETTEXT, 0, (LPARAM)L"");
|
||||
wsprintfW(text, szCpuUsage, PerfDataGetProcessorUsage());
|
||||
SendMessageW(hStatusWnd, SB_SETTEXT, 1, (LPARAM)text);
|
||||
wsprintfW(text, szProcesses, PerfDataGetProcessCount());
|
||||
SendMessageW(hStatusWnd, SB_SETTEXT, 0, (LPARAM)text);
|
||||
}
|
||||
|
||||
void TaskManager_OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
|
||||
|
@ -808,15 +808,15 @@ void TaskManager_OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMe
|
|||
WCHAR str[100];
|
||||
|
||||
wcscpy(str, L"");
|
||||
if (LoadString(hInst, nItemID, str, 100)) {
|
||||
if (LoadStringW(hInst, nItemID, str, 100)) {
|
||||
/* load appropriate string */
|
||||
LPTSTR lpsz = str;
|
||||
LPWSTR lpsz = str;
|
||||
/* first newline terminates actual string */
|
||||
lpsz = wcschr(lpsz, '\n');
|
||||
if (lpsz != NULL)
|
||||
*lpsz = '\0';
|
||||
}
|
||||
SendMessage(hStatusWnd, SB_SETTEXT, 0, (LPARAM)str);
|
||||
SendMessageW(hStatusWnd, SB_SETTEXT, 0, (LPARAM)str);
|
||||
}
|
||||
|
||||
void TaskManager_OnViewUpdateSpeedHigh(void)
|
||||
|
@ -872,7 +872,7 @@ void TaskManager_OnViewUpdateSpeedLow(void)
|
|||
|
||||
void TaskManager_OnViewRefresh(void)
|
||||
{
|
||||
PostMessage(hMainWnd, WM_TIMER, 0, 0);
|
||||
PostMessageW(hMainWnd, WM_TIMER, 0, 0);
|
||||
}
|
||||
|
||||
void TaskManager_OnViewUpdateSpeedPaused(void)
|
||||
|
@ -916,20 +916,20 @@ void TaskManager_OnTabWndSelChange(void)
|
|||
ShowWindow(hPerformancePage, SW_HIDE);
|
||||
BringWindowToTop(hApplicationPage);
|
||||
|
||||
LoadString(hInst, IDS_MENU_LARGEICONS, szTemp, 256);
|
||||
AppendMenu(hViewMenu, MF_STRING, ID_VIEW_LARGE, szTemp);
|
||||
LoadStringW(hInst, IDS_MENU_LARGEICONS, szTemp, 256);
|
||||
AppendMenuW(hViewMenu, MF_STRING, ID_VIEW_LARGE, szTemp);
|
||||
|
||||
LoadString(hInst, IDS_MENU_SMALLICONS, szTemp, 256);
|
||||
AppendMenu(hViewMenu, MF_STRING, ID_VIEW_SMALL, szTemp);
|
||||
LoadStringW(hInst, IDS_MENU_SMALLICONS, szTemp, 256);
|
||||
AppendMenuW(hViewMenu, MF_STRING, ID_VIEW_SMALL, szTemp);
|
||||
|
||||
LoadString(hInst, IDS_MENU_DETAILS, szTemp, 256);
|
||||
AppendMenu(hViewMenu, MF_STRING, ID_VIEW_DETAILS, szTemp);
|
||||
LoadStringW(hInst, IDS_MENU_DETAILS, szTemp, 256);
|
||||
AppendMenuW(hViewMenu, MF_STRING, ID_VIEW_DETAILS, szTemp);
|
||||
|
||||
if (GetMenuItemCount(hMenu) <= 4) {
|
||||
hSubMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_WINDOWSMENU));
|
||||
hSubMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_WINDOWSMENU));
|
||||
|
||||
LoadString(hInst, IDS_MENU_WINDOWS, szTemp, 256);
|
||||
InsertMenu(hMenu, 3, MF_BYPOSITION|MF_POPUP, (UINT_PTR) hSubMenu, szTemp);
|
||||
LoadStringW(hInst, IDS_MENU_WINDOWS, szTemp, 256);
|
||||
InsertMenuW(hMenu, 3, MF_BYPOSITION|MF_POPUP, (UINT_PTR) hSubMenu, szTemp);
|
||||
|
||||
DrawMenuBar(hMainWnd);
|
||||
}
|
||||
|
@ -951,11 +951,11 @@ void TaskManager_OnTabWndSelChange(void)
|
|||
ShowWindow(hPerformancePage, SW_HIDE);
|
||||
BringWindowToTop(hProcessPage);
|
||||
|
||||
LoadString(hInst, IDS_MENU_SELECTCOLUMNS, szTemp, 256);
|
||||
AppendMenu(hViewMenu, MF_STRING, ID_VIEW_SELECTCOLUMNS, szTemp);
|
||||
LoadStringW(hInst, IDS_MENU_SELECTCOLUMNS, szTemp, 256);
|
||||
AppendMenuW(hViewMenu, MF_STRING, ID_VIEW_SELECTCOLUMNS, szTemp);
|
||||
|
||||
LoadString(hInst, IDS_MENU_16BITTASK, szTemp, 256);
|
||||
AppendMenu(hOptionsMenu, MF_STRING, ID_OPTIONS_SHOW16BITTASKS, szTemp);
|
||||
LoadStringW(hInst, IDS_MENU_16BITTASK, szTemp, 256);
|
||||
AppendMenuW(hOptionsMenu, MF_STRING, ID_OPTIONS_SHOW16BITTASKS, szTemp);
|
||||
|
||||
if (TaskManagerSettings.Show16BitTasks)
|
||||
CheckMenuItem(hOptionsMenu, ID_OPTIONS_SHOW16BITTASKS, MF_BYCOMMAND|MF_CHECKED);
|
||||
|
@ -981,17 +981,17 @@ void TaskManager_OnTabWndSelChange(void)
|
|||
}
|
||||
hSubMenu = CreatePopupMenu();
|
||||
|
||||
LoadString(hInst, IDS_MENU_ONEGRAPHALLCPUS, szTemp, 256);
|
||||
AppendMenu(hSubMenu, MF_STRING, ID_VIEW_CPUHISTORY_ONEGRAPHALL, szTemp);
|
||||
LoadStringW(hInst, IDS_MENU_ONEGRAPHALLCPUS, szTemp, 256);
|
||||
AppendMenuW(hSubMenu, MF_STRING, ID_VIEW_CPUHISTORY_ONEGRAPHALL, szTemp);
|
||||
|
||||
LoadString(hInst, IDS_MENU_ONEGRAPHPERCPU, szTemp, 256);
|
||||
AppendMenu(hSubMenu, MF_STRING, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, szTemp);
|
||||
LoadStringW(hInst, IDS_MENU_ONEGRAPHPERCPU, szTemp, 256);
|
||||
AppendMenuW(hSubMenu, MF_STRING, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, szTemp);
|
||||
|
||||
LoadString(hInst, IDS_MENU_CPUHISTORY, szTemp, 256);
|
||||
AppendMenu(hViewMenu, MF_STRING|MF_POPUP, (UINT_PTR) hSubMenu, szTemp);
|
||||
LoadStringW(hInst, IDS_MENU_CPUHISTORY, szTemp, 256);
|
||||
AppendMenuW(hViewMenu, MF_STRING|MF_POPUP, (UINT_PTR) hSubMenu, szTemp);
|
||||
|
||||
LoadString(hInst, IDS_MENU_SHOWKERNELTIMES, szTemp, 256);
|
||||
AppendMenu(hViewMenu, MF_STRING, ID_VIEW_SHOWKERNELTIMES, szTemp);
|
||||
LoadStringW(hInst, IDS_MENU_SHOWKERNELTIMES, szTemp, 256);
|
||||
AppendMenuW(hViewMenu, MF_STRING, ID_VIEW_SHOWKERNELTIMES, szTemp);
|
||||
|
||||
if (TaskManagerSettings.ShowKernelTimes)
|
||||
CheckMenuItem(hViewMenu, ID_VIEW_SHOWKERNELTIMES, MF_BYCOMMAND|MF_CHECKED);
|
||||
|
@ -1009,16 +1009,16 @@ void TaskManager_OnTabWndSelChange(void)
|
|||
}
|
||||
}
|
||||
|
||||
LPTSTR GetLastErrorText(LPTSTR lpszBuf, DWORD dwSize)
|
||||
LPWSTR GetLastErrorText(LPWSTR lpszBuf, DWORD dwSize)
|
||||
{
|
||||
DWORD dwRet;
|
||||
LPTSTR lpszTemp = NULL;
|
||||
LPWSTR lpszTemp = NULL;
|
||||
|
||||
dwRet = FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_ARGUMENT_ARRAY,
|
||||
dwRet = FormatMessageW( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_ARGUMENT_ARRAY,
|
||||
NULL,
|
||||
GetLastError(),
|
||||
LANG_NEUTRAL,
|
||||
(LPTSTR)&lpszTemp,
|
||||
(LPWSTR)&lpszTemp,
|
||||
0,
|
||||
NULL );
|
||||
|
||||
|
@ -1026,8 +1026,8 @@ LPTSTR GetLastErrorText(LPTSTR lpszBuf, DWORD dwSize)
|
|||
if (!dwRet || ( (long)dwSize < (long)dwRet+14)) {
|
||||
lpszBuf[0] = L'\0';
|
||||
} else {
|
||||
lpszTemp[lstrlen(lpszTemp)-2] = L'\0'; /*remove cr and newline character */
|
||||
wsprintf(lpszBuf, L"%s (0x%x)", lpszTemp, (int)GetLastError());
|
||||
lpszTemp[lstrlenW(lpszTemp)-2] = L'\0'; /*remove cr and newline character */
|
||||
wsprintfW(lpszBuf, L"%s (0x%x)", lpszTemp, (int)GetLastError());
|
||||
}
|
||||
if (lpszTemp) {
|
||||
LocalFree((HLOCAL)lpszTemp);
|
||||
|
|
|
@ -54,8 +54,8 @@ HICON TrayIcon_GetProcessorUsageIcon(void)
|
|||
/*
|
||||
* Load the bitmaps
|
||||
*/
|
||||
hBitmap = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_TRAYICON));
|
||||
hBitmapMask = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_TRAYMASK));
|
||||
hBitmap = LoadBitmapW(hInst, MAKEINTRESOURCEW(IDB_TRAYICON));
|
||||
hBitmapMask = LoadBitmapW(hInst, MAKEINTRESOURCEW(IDB_TRAYMASK));
|
||||
if (!hBitmap || !hBitmapMask)
|
||||
goto done;
|
||||
|
||||
|
@ -132,16 +132,16 @@ done:
|
|||
|
||||
BOOL TrayIcon_ShellAddTrayIcon(void)
|
||||
{
|
||||
NOTIFYICONDATA nid;
|
||||
NOTIFYICONDATAW nid;
|
||||
HICON hIcon = NULL;
|
||||
BOOL bRetVal;
|
||||
WCHAR szMsg[256];
|
||||
|
||||
memset(&nid, 0, sizeof(NOTIFYICONDATA));
|
||||
memset(&nid, 0, sizeof(NOTIFYICONDATAW));
|
||||
|
||||
hIcon = TrayIcon_GetProcessorUsageIcon();
|
||||
|
||||
nid.cbSize = sizeof(NOTIFYICONDATA);
|
||||
nid.cbSize = sizeof(NOTIFYICONDATAW);
|
||||
nid.hWnd = hMainWnd;
|
||||
nid.uID = 0;
|
||||
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
|
||||
|
@ -149,10 +149,10 @@ BOOL TrayIcon_ShellAddTrayIcon(void)
|
|||
nid.hIcon = hIcon;
|
||||
|
||||
|
||||
LoadString( GetModuleHandle(NULL), IDS_MSG_TRAYICONCPUUSAGE, szMsg, sizeof(szMsg) / sizeof(szMsg[0]));
|
||||
wsprintf(nid.szTip, szMsg, PerfDataGetProcessorUsage());
|
||||
LoadStringW( GetModuleHandleW(NULL), IDS_MSG_TRAYICONCPUUSAGE, szMsg, sizeof(szMsg) / sizeof(szMsg[0]));
|
||||
wsprintfW(nid.szTip, szMsg, PerfDataGetProcessorUsage());
|
||||
|
||||
bRetVal = Shell_NotifyIcon(NIM_ADD, &nid);
|
||||
bRetVal = Shell_NotifyIconW(NIM_ADD, &nid);
|
||||
|
||||
if (hIcon)
|
||||
DestroyIcon(hIcon);
|
||||
|
@ -162,43 +162,43 @@ BOOL TrayIcon_ShellAddTrayIcon(void)
|
|||
|
||||
BOOL TrayIcon_ShellRemoveTrayIcon(void)
|
||||
{
|
||||
NOTIFYICONDATA nid;
|
||||
NOTIFYICONDATAW nid;
|
||||
BOOL bRetVal;
|
||||
|
||||
memset(&nid, 0, sizeof(NOTIFYICONDATA));
|
||||
memset(&nid, 0, sizeof(NOTIFYICONDATAW));
|
||||
|
||||
nid.cbSize = sizeof(NOTIFYICONDATA);
|
||||
nid.cbSize = sizeof(NOTIFYICONDATAW);
|
||||
nid.hWnd = hMainWnd;
|
||||
nid.uID = 0;
|
||||
nid.uFlags = 0;
|
||||
nid.uCallbackMessage = WM_ONTRAYICON;
|
||||
|
||||
bRetVal = Shell_NotifyIcon(NIM_DELETE, &nid);
|
||||
bRetVal = Shell_NotifyIconW(NIM_DELETE, &nid);
|
||||
|
||||
return bRetVal;
|
||||
}
|
||||
|
||||
BOOL TrayIcon_ShellUpdateTrayIcon(void)
|
||||
{
|
||||
NOTIFYICONDATA nid;
|
||||
NOTIFYICONDATAW nid;
|
||||
HICON hIcon = NULL;
|
||||
BOOL bRetVal;
|
||||
WCHAR szTemp[256];
|
||||
|
||||
memset(&nid, 0, sizeof(NOTIFYICONDATA));
|
||||
memset(&nid, 0, sizeof(NOTIFYICONDATAW));
|
||||
|
||||
hIcon = TrayIcon_GetProcessorUsageIcon();
|
||||
|
||||
nid.cbSize = sizeof(NOTIFYICONDATA);
|
||||
nid.cbSize = sizeof(NOTIFYICONDATAW);
|
||||
nid.hWnd = hMainWnd;
|
||||
nid.uID = 0;
|
||||
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
|
||||
nid.uCallbackMessage = WM_ONTRAYICON;
|
||||
nid.hIcon = hIcon;
|
||||
LoadString(hInst, IDS_MSG_TRAYICONCPUUSAGE, szTemp, 256);
|
||||
wsprintf(nid.szTip, szTemp, PerfDataGetProcessorUsage());
|
||||
LoadStringW(hInst, IDS_MSG_TRAYICONCPUUSAGE, szTemp, 256);
|
||||
wsprintfW(nid.szTip, szTemp, PerfDataGetProcessorUsage());
|
||||
|
||||
bRetVal = Shell_NotifyIcon(NIM_MODIFY, &nid);
|
||||
bRetVal = Shell_NotifyIconW(NIM_MODIFY, &nid);
|
||||
|
||||
if (hIcon)
|
||||
DestroyIcon(hIcon);
|
||||
|
|
Loading…
Reference in a new issue