2004-03-23 02:19:54 +01:00
|
|
|
/*
|
|
|
|
* ReactOS Task Manager
|
|
|
|
*
|
|
|
|
* column.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org>
|
2008-08-20 10:34:12 +02:00
|
|
|
* Copyright (C) 2008 Vladimir Pankratov
|
2004-03-23 02:19:54 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2004-03-23 02:19:54 +01:00
|
|
|
*/
|
|
|
|
|
2012-01-23 12:04:05 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2004-03-23 02:19:54 +01:00
|
|
|
#include <windows.h>
|
|
|
|
#include <commctrl.h>
|
2012-01-23 12:04:05 +01:00
|
|
|
|
2008-08-20 10:34:12 +02:00
|
|
|
#include "wine/unicode.h"
|
2004-03-23 02:19:54 +01:00
|
|
|
#include "taskmgr.h"
|
|
|
|
#include "column.h"
|
|
|
|
|
|
|
|
UINT ColumnDataHints[25];
|
|
|
|
|
2008-08-20 10:34:12 +02:00
|
|
|
/* Column Headers; Begin */
|
2010-10-01 13:38:24 +02:00
|
|
|
static WCHAR wszImageName[255];
|
|
|
|
static WCHAR wszPID[255];
|
|
|
|
static WCHAR wszUserName[255];
|
|
|
|
static WCHAR wszSessionID[255];
|
|
|
|
static WCHAR wszCPU[255];
|
|
|
|
static WCHAR wszCPUTime[255];
|
|
|
|
static WCHAR wszMemUsage[255];
|
|
|
|
static WCHAR wszPeakMemUsage[255];
|
|
|
|
static WCHAR wszMemDelta[255];
|
|
|
|
static WCHAR wszPageFaults[255];
|
|
|
|
static WCHAR wszPFDelta[255];
|
|
|
|
static WCHAR wszVMSize[255];
|
|
|
|
static WCHAR wszPagedPool[255];
|
|
|
|
static WCHAR wszNPPool[255];
|
|
|
|
static WCHAR wszBasePri[255];
|
|
|
|
static WCHAR wszHandles[255];
|
|
|
|
static WCHAR wszThreads[255];
|
|
|
|
static WCHAR wszUSERObjects[255];
|
|
|
|
static WCHAR wszGDIObjects[255];
|
|
|
|
static WCHAR wszIOReads[255];
|
|
|
|
static WCHAR wszIOWrites[255];
|
|
|
|
static WCHAR wszIOOther[255];
|
|
|
|
static WCHAR wszIOReadBytes[255];
|
|
|
|
static WCHAR wszIOWriteBytes[255];
|
|
|
|
static WCHAR wszIOOtherBytes[255];
|
2008-08-20 10:34:12 +02:00
|
|
|
/* Column Headers; End */
|
|
|
|
|
2009-06-22 18:50:51 +02:00
|
|
|
static void load_column_headers(void)
|
|
|
|
{
|
|
|
|
LoadStringW(hInst, IDS_IMAGENAME, wszImageName, sizeof(wszImageName)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_PID, wszPID, sizeof(wszPID)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_USERNAME, wszUserName, sizeof(wszUserName)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_SESSIONID, wszSessionID, sizeof(wszSessionID)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_CPUUSAGE, wszCPU, sizeof(wszCPU)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_CPUTIME, wszCPUTime, sizeof(wszCPUTime)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_MEMORYUSAGE, wszMemUsage, sizeof(wszMemUsage)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_PEAKMEMORYUSAGE, wszPeakMemUsage, sizeof(wszPeakMemUsage)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_MEMORYUSAGEDELTA, wszMemDelta, sizeof(wszMemDelta)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_PAGEFAULTS, wszPageFaults, sizeof(wszPageFaults)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_PAGEFAULTSDELTA, wszPFDelta, sizeof(wszPFDelta)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_VIRTUALMEMORYSIZE, wszVMSize, sizeof(wszVMSize)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_PAGEDPOOL, wszPagedPool, sizeof(wszPagedPool)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_NONPAGEDPOOL, wszNPPool, sizeof(wszNPPool)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_BASEPRIORITY, wszBasePri, sizeof(wszBasePri)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_HANDLECOUNT, wszHandles, sizeof(wszHandles)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_THREADCOUNT, wszThreads, sizeof(wszThreads)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_USEROBJECTS, wszUSERObjects, sizeof(wszUSERObjects)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_GDIOBJECTS, wszGDIObjects, sizeof(wszGDIObjects)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_IOREADS, wszIOReads, sizeof(wszIOReads)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_IOWRITES, wszIOWrites, sizeof(wszIOWrites)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_IOOTHER, wszIOOther, sizeof(wszIOOther)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_IOREADBYTES, wszIOReadBytes, sizeof(wszIOReadBytes)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_IOWRITEBYTES, wszIOWriteBytes, sizeof(wszIOWriteBytes)/sizeof(WCHAR));
|
|
|
|
LoadStringW(hInst, IDS_IOOTHERBYTES, wszIOOtherBytes, sizeof(wszIOOtherBytes)/sizeof(WCHAR));
|
|
|
|
}
|
|
|
|
|
2008-08-20 10:34:12 +02:00
|
|
|
static int InsertColumn(int nCol, LPCWSTR lpszColumnHeading, int nFormat, int nWidth, int nSubItem)
|
2006-03-21 18:32:40 +01:00
|
|
|
{
|
2008-08-20 10:34:12 +02:00
|
|
|
LVCOLUMNW column;
|
2006-03-21 18:32:40 +01:00
|
|
|
|
|
|
|
column.mask = LVCF_TEXT|LVCF_FMT;
|
2008-08-20 10:34:12 +02:00
|
|
|
column.pszText = (LPWSTR)lpszColumnHeading;
|
2006-03-21 18:32:40 +01:00
|
|
|
column.fmt = nFormat;
|
|
|
|
|
|
|
|
if (nWidth != -1)
|
|
|
|
{
|
|
|
|
column.mask |= LVCF_WIDTH;
|
|
|
|
column.cx = nWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (nSubItem != -1)
|
|
|
|
{
|
|
|
|
column.mask |= LVCF_SUBITEM;
|
|
|
|
column.iSubItem = nSubItem;
|
|
|
|
}
|
|
|
|
|
2008-08-20 10:34:12 +02:00
|
|
|
return ListView_InsertColumnW(hProcessPageListCtrl, nCol, &column);
|
2006-03-21 18:32:40 +01:00
|
|
|
}
|
2004-03-23 02:19:54 +01:00
|
|
|
|
|
|
|
void AddColumns(void)
|
|
|
|
{
|
|
|
|
int size;
|
|
|
|
|
2009-06-22 18:50:51 +02:00
|
|
|
load_column_headers();
|
|
|
|
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_ImageName)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(0, wszImageName, LVCFMT_LEFT, TaskManagerSettings.ColumnSizeArray[0], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_PID)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(1, wszPID, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[1], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_UserName)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(2, wszUserName, LVCFMT_LEFT, TaskManagerSettings.ColumnSizeArray[2], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_SessionID)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(3, wszSessionID, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[3], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_CPUUsage)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(4, wszCPU, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[4], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_CPUTime)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(5, wszCPUTime, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[5], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_MemoryUsage)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(6, wszMemUsage, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[6], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_PeakMemoryUsage)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(7, wszPeakMemUsage, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[7], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_MemoryUsageDelta)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(8, wszMemDelta, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[8], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_PageFaults)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(9, wszPageFaults, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[9], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_PageFaultsDelta)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(10, wszPFDelta, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[10], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_VirtualMemorySize)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(11, wszVMSize, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[11], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_PagedPool)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(12, wszPagedPool, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[12], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_NonPagedPool)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(13, wszNPPool, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[13], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_BasePriority)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(14, wszBasePri, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[14], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_HandleCount)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(15, wszHandles, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[15], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_ThreadCount)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(16, wszThreads, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[16], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_USERObjects)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(17, wszUSERObjects, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[17], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_GDIObjects)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(18, wszGDIObjects, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[18], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_IOReads)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(19, wszIOReads, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[19], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_IOWrites)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(20, wszIOWrites, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[20], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_IOOther)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(21, wszIOOther, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[21], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_IOReadBytes)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(22, wszIOReadBytes, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[22], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_IOWriteBytes)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(23, wszIOWriteBytes, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[23], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
if (TaskManagerSettings.Column_IOOtherBytes)
|
2008-08-20 10:34:12 +02:00
|
|
|
InsertColumn(24, wszIOOtherBytes, LVCFMT_RIGHT, TaskManagerSettings.ColumnSizeArray[24], -1);
|
2004-03-23 02:19:54 +01:00
|
|
|
|
2008-08-20 10:34:12 +02:00
|
|
|
size = SendMessageW(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0);
|
2015-03-30 22:49:44 +02:00
|
|
|
SendMessageW(hProcessPageListCtrl, LVM_SETCOLUMNORDERARRAY, (WPARAM) size, (LPARAM) &TaskManagerSettings.ColumnOrderArray);
|
2004-03-23 02:19:54 +01:00
|
|
|
|
|
|
|
UpdateColumnDataHints();
|
|
|
|
}
|
|
|
|
|
2006-03-21 18:32:40 +01:00
|
|
|
static INT_PTR CALLBACK ColumnsDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
|
2006-03-21 18:32:40 +01:00
|
|
|
switch (message)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
2006-03-21 18:32:40 +01:00
|
|
|
case WM_INITDIALOG:
|
2004-03-23 02:19:54 +01:00
|
|
|
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_ImageName)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_IMAGENAME), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_PID)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_PID), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_UserName)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_USERNAME), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_SessionID)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_SESSIONID), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_CPUUsage)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_CPUUSAGE), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_CPUTime)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_CPUTIME), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_MemoryUsage)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_MEMORYUSAGE), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_PeakMemoryUsage)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_PEAKMEMORYUSAGE), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_MemoryUsageDelta)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_MEMORYUSAGEDELTA), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_PageFaults)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_PAGEFAULTS), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_PageFaultsDelta)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_PAGEFAULTSDELTA), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_VirtualMemorySize)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_VIRTUALMEMORYSIZE), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_PagedPool)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_PAGEDPOOL), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_NonPagedPool)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_NONPAGEDPOOL), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_BasePriority)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_BASEPRIORITY), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_HandleCount)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_HANDLECOUNT), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_ThreadCount)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_THREADCOUNT), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_USERObjects)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_USEROBJECTS), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_GDIObjects)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_GDIOBJECTS), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_IOReads)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_IOREADS), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_IOWrites)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_IOWRITES), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_IOOther)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_IOOTHER), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_IOReadBytes)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_IOREADBYTES), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_IOWriteBytes)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_IOWRITEBYTES), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
if (TaskManagerSettings.Column_IOOtherBytes)
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(GetDlgItem(hDlg, IDC_IOOTHERBYTES), BM_SETCHECK, BST_CHECKED, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
case WM_COMMAND:
|
|
|
|
|
|
|
|
if (LOWORD(wParam) == IDCANCEL)
|
|
|
|
{
|
|
|
|
EndDialog(hDlg, LOWORD(wParam));
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (LOWORD(wParam) == IDOK)
|
|
|
|
{
|
2008-08-20 10:34:12 +02:00
|
|
|
TaskManagerSettings.Column_ImageName = SendMessageW(GetDlgItem(hDlg, IDC_IMAGENAME), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_PID = SendMessageW(GetDlgItem(hDlg, IDC_PID), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_UserName = SendMessageW(GetDlgItem(hDlg, IDC_USERNAME), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_SessionID = SendMessageW(GetDlgItem(hDlg, IDC_SESSIONID), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_CPUUsage = SendMessageW(GetDlgItem(hDlg, IDC_CPUUSAGE), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_CPUTime = SendMessageW(GetDlgItem(hDlg, IDC_CPUTIME), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_MemoryUsage = SendMessageW(GetDlgItem(hDlg, IDC_MEMORYUSAGE), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_PeakMemoryUsage = SendMessageW(GetDlgItem(hDlg, IDC_PEAKMEMORYUSAGE), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_MemoryUsageDelta = SendMessageW(GetDlgItem(hDlg, IDC_MEMORYUSAGEDELTA), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_PageFaults = SendMessageW(GetDlgItem(hDlg, IDC_PAGEFAULTS), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_PageFaultsDelta = SendMessageW(GetDlgItem(hDlg, IDC_PAGEFAULTSDELTA), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_VirtualMemorySize = SendMessageW(GetDlgItem(hDlg, IDC_VIRTUALMEMORYSIZE), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_PagedPool = SendMessageW(GetDlgItem(hDlg, IDC_PAGEDPOOL), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_NonPagedPool = SendMessageW(GetDlgItem(hDlg, IDC_NONPAGEDPOOL), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_BasePriority = SendMessageW(GetDlgItem(hDlg, IDC_BASEPRIORITY), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_HandleCount = SendMessageW(GetDlgItem(hDlg, IDC_HANDLECOUNT), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_ThreadCount = SendMessageW(GetDlgItem(hDlg, IDC_THREADCOUNT), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_USERObjects = SendMessageW(GetDlgItem(hDlg, IDC_USEROBJECTS), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_GDIObjects = SendMessageW(GetDlgItem(hDlg, IDC_GDIOBJECTS), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_IOReads = SendMessageW(GetDlgItem(hDlg, IDC_IOREADS), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_IOWrites = SendMessageW(GetDlgItem(hDlg, IDC_IOWRITES), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_IOOther = SendMessageW(GetDlgItem(hDlg, IDC_IOOTHER), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_IOReadBytes = SendMessageW(GetDlgItem(hDlg, IDC_IOREADBYTES), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_IOWriteBytes = SendMessageW(GetDlgItem(hDlg, IDC_IOWRITEBYTES), BM_GETCHECK, 0, 0);
|
|
|
|
TaskManagerSettings.Column_IOOtherBytes = SendMessageW(GetDlgItem(hDlg, IDC_IOOTHERBYTES), BM_GETCHECK, 0, 0);
|
2006-03-21 18:32:40 +01:00
|
|
|
|
|
|
|
EndDialog(hDlg, LOWORD(wParam));
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
2004-03-23 02:19:54 +01:00
|
|
|
}
|
|
|
|
|
2006-03-21 18:32:40 +01:00
|
|
|
return 0;
|
2004-03-23 02:19:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void SaveColumnSettings(void)
|
|
|
|
{
|
2008-08-20 10:34:12 +02:00
|
|
|
HDITEMW hditem;
|
2004-03-23 02:19:54 +01:00
|
|
|
int i;
|
2008-08-20 10:34:12 +02:00
|
|
|
WCHAR text[256];
|
2004-03-23 02:19:54 +01:00
|
|
|
int size;
|
|
|
|
|
|
|
|
/* Reset column data */
|
|
|
|
for (i=0; i<25; i++)
|
|
|
|
TaskManagerSettings.ColumnOrderArray[i] = i;
|
|
|
|
|
|
|
|
TaskManagerSettings.Column_ImageName = FALSE;
|
|
|
|
TaskManagerSettings.Column_PID = FALSE;
|
|
|
|
TaskManagerSettings.Column_CPUUsage = FALSE;
|
|
|
|
TaskManagerSettings.Column_CPUTime = FALSE;
|
|
|
|
TaskManagerSettings.Column_MemoryUsage = FALSE;
|
|
|
|
TaskManagerSettings.Column_MemoryUsageDelta = FALSE;
|
|
|
|
TaskManagerSettings.Column_PeakMemoryUsage = FALSE;
|
|
|
|
TaskManagerSettings.Column_PageFaults = FALSE;
|
|
|
|
TaskManagerSettings.Column_USERObjects = FALSE;
|
|
|
|
TaskManagerSettings.Column_IOReads = FALSE;
|
|
|
|
TaskManagerSettings.Column_IOReadBytes = FALSE;
|
|
|
|
TaskManagerSettings.Column_SessionID = FALSE;
|
|
|
|
TaskManagerSettings.Column_UserName = FALSE;
|
|
|
|
TaskManagerSettings.Column_PageFaultsDelta = FALSE;
|
|
|
|
TaskManagerSettings.Column_VirtualMemorySize = FALSE;
|
|
|
|
TaskManagerSettings.Column_PagedPool = FALSE;
|
|
|
|
TaskManagerSettings.Column_NonPagedPool = FALSE;
|
|
|
|
TaskManagerSettings.Column_BasePriority = FALSE;
|
|
|
|
TaskManagerSettings.Column_HandleCount = FALSE;
|
|
|
|
TaskManagerSettings.Column_ThreadCount = FALSE;
|
|
|
|
TaskManagerSettings.Column_GDIObjects = FALSE;
|
|
|
|
TaskManagerSettings.Column_IOWrites = FALSE;
|
|
|
|
TaskManagerSettings.Column_IOWriteBytes = FALSE;
|
|
|
|
TaskManagerSettings.Column_IOOther = FALSE;
|
|
|
|
TaskManagerSettings.Column_IOOtherBytes = FALSE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[0] = 105;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[1] = 50;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[2] = 107;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[3] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[4] = 35;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[5] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[6] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[7] = 100;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[8] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[9] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[10] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[11] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[12] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[13] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[14] = 60;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[15] = 60;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[16] = 60;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[17] = 60;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[18] = 60;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[19] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[20] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[21] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[22] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[23] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[24] = 70;
|
|
|
|
|
|
|
|
/* Get header order */
|
2008-08-20 10:34:12 +02:00
|
|
|
size = SendMessageW(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0);
|
|
|
|
SendMessageW(hProcessPageHeaderCtrl, HDM_GETORDERARRAY, (WPARAM) size, (LPARAM) &TaskManagerSettings.ColumnOrderArray);
|
2004-03-23 02:19:54 +01:00
|
|
|
|
|
|
|
/* Get visible columns */
|
2008-08-20 10:34:12 +02:00
|
|
|
for (i=0; i<SendMessageW(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0); i++) {
|
|
|
|
memset(&hditem, 0, sizeof(HDITEMW));
|
2004-03-23 02:19:54 +01:00
|
|
|
|
|
|
|
hditem.mask = HDI_TEXT|HDI_WIDTH;
|
|
|
|
hditem.pszText = text;
|
2008-08-20 10:34:12 +02:00
|
|
|
hditem.cchTextMax = 256;
|
2004-03-23 02:19:54 +01:00
|
|
|
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(hProcessPageHeaderCtrl, HDM_GETITEMW, i, (LPARAM) &hditem);
|
2004-03-23 02:19:54 +01:00
|
|
|
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszImageName) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_ImageName = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[0] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszPID) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_PID = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[1] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszUserName) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_UserName = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[2] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszSessionID) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_SessionID = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[3] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszCPU) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_CPUUsage = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[4] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszCPUTime) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_CPUTime = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[5] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszMemUsage) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_MemoryUsage = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[6] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszPeakMemUsage) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_PeakMemoryUsage = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[7] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszMemDelta) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_MemoryUsageDelta = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[8] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszPageFaults) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_PageFaults = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[9] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszPFDelta) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_PageFaultsDelta = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[10] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszVMSize) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_VirtualMemorySize = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[11] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszPagedPool) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_PagedPool = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[12] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszNPPool) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_NonPagedPool = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[13] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszBasePri) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_BasePriority = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[14] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszHandles) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_HandleCount = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[15] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszThreads) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_ThreadCount = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[16] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszUSERObjects) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_USERObjects = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[17] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszGDIObjects) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_GDIObjects = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[18] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszIOReads) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_IOReads = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[19] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszIOWrites) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_IOWrites = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[20] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszIOOther) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_IOOther = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[21] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszIOReadBytes) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_IOReadBytes = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[22] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszIOWriteBytes) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_IOWriteBytes = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[23] = hditem.cxy;
|
|
|
|
}
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszIOOtherBytes) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
|
|
|
TaskManagerSettings.Column_IOOtherBytes = TRUE;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[24] = hditem.cxy;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ProcessPage_OnViewSelectColumns(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2008-08-20 10:34:12 +02:00
|
|
|
if (DialogBoxW(hInst, MAKEINTRESOURCEW(IDD_COLUMNS_DIALOG), hMainWnd, ColumnsDialogWndProc) == IDOK)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
2011-05-17 12:15:28 +02:00
|
|
|
for (i=SendMessageW(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0)-1; i>=0; i--)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
2011-05-17 12:15:28 +02:00
|
|
|
SendMessageW(hProcessPageListCtrl, LVM_DELETECOLUMN, 0, i);
|
2004-03-23 02:19:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
for (i=0; i<25; i++)
|
|
|
|
TaskManagerSettings.ColumnOrderArray[i] = i;
|
|
|
|
|
|
|
|
TaskManagerSettings.ColumnSizeArray[0] = 105;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[1] = 50;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[2] = 107;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[3] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[4] = 35;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[5] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[6] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[7] = 100;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[8] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[9] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[10] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[11] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[12] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[13] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[14] = 60;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[15] = 60;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[16] = 60;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[17] = 60;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[18] = 60;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[19] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[20] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[21] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[22] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[23] = 70;
|
|
|
|
TaskManagerSettings.ColumnSizeArray[24] = 70;
|
|
|
|
|
|
|
|
AddColumns();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void UpdateColumnDataHints(void)
|
|
|
|
{
|
2008-08-20 10:34:12 +02:00
|
|
|
HDITEMW hditem;
|
|
|
|
WCHAR text[256];
|
2004-03-23 02:19:54 +01:00
|
|
|
ULONG Index;
|
|
|
|
|
2008-08-20 10:34:12 +02:00
|
|
|
for (Index=0; Index<(ULONG)SendMessageW(hProcessPageHeaderCtrl, HDM_GETITEMCOUNT, 0, 0); Index++)
|
2004-03-23 02:19:54 +01:00
|
|
|
{
|
2008-08-20 10:34:12 +02:00
|
|
|
memset(&hditem, 0, sizeof(HDITEMW));
|
2004-03-23 02:19:54 +01:00
|
|
|
|
|
|
|
hditem.mask = HDI_TEXT;
|
|
|
|
hditem.pszText = text;
|
|
|
|
hditem.cchTextMax = 260;
|
|
|
|
|
2008-08-20 10:34:12 +02:00
|
|
|
SendMessageW(hProcessPageHeaderCtrl, HDM_GETITEMW, Index, (LPARAM) &hditem);
|
2004-03-23 02:19:54 +01:00
|
|
|
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszImageName) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_IMAGENAME;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszPID) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_PID;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszUserName) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_USERNAME;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszSessionID) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_SESSIONID;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszCPU) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_CPUUSAGE;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszCPUTime) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_CPUTIME;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszMemUsage) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_MEMORYUSAGE;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszPeakMemUsage) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_PEAKMEMORYUSAGE;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszMemDelta) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_MEMORYUSAGEDELTA;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszPageFaults) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_PAGEFAULTS;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszPFDelta) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_PAGEFAULTSDELTA;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszVMSize) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_VIRTUALMEMORYSIZE;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszPagedPool) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_PAGEDPOOL;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszNPPool) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_NONPAGEDPOOL;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszBasePri) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_BASEPRIORITY;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszHandles) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_HANDLECOUNT;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszThreads) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_THREADCOUNT;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszUSERObjects) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_USEROBJECTS;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszGDIObjects) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_GDIOBJECTS;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszIOReads) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_IOREADS;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszIOWrites) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_IOWRITES;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszIOOther) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_IOOTHER;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszIOReadBytes) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_IOREADBYTES;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszIOWriteBytes) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_IOWRITEBYTES;
|
2008-08-20 10:34:12 +02:00
|
|
|
if (strcmpW(text, wszIOOtherBytes) == 0)
|
2004-03-23 02:19:54 +01:00
|
|
|
ColumnDataHints[Index] = COLUMN_IOOTHERBYTES;
|
|
|
|
}
|
|
|
|
}
|