Isira Seneviratne isirasen96@gmail.com writes:
@@ -60,33 +61,48 @@ static WCHAR wszIOWriteBytes[255]; static WCHAR wszIOOtherBytes[255]; /* Column Headers; End */
+const int ColumnSizeArrayValues[] = { 105, 50, 107, 70, 35, 70, 70, 100, 70, 70, 70, 70,
70, 70, 60, 60, 60, 60, 60, 70, 70, 70, 70, 70, 70 };
+static WCHAR *wszPointers[] = { wszImageName, wszPID, wszUserName, wszSessionID, wszCPU, wszCPUTime,
wszMemUsage, wszPeakMemUsage, wszMemDelta, wszPageFaults, wszPFDelta,
wszVMSize, wszPagedPool, wszNPPool, wszBasePri, wszHandles, wszThreads,
wszUSERObjects, wszGDIObjects, wszIOReads, wszIOWrites, wszIOOther,
wszIOReadBytes, wszIOWriteBytes, wszIOOtherBytes };
+static const int IDSValues[] = { IDS_IMAGENAME, IDS_PID, IDS_USERNAME, IDS_SESSIONID, IDS_CPUUSAGE, IDS_CPUTIME,
IDS_MEMORYUSAGE, IDS_PEAKMEMORYUSAGE, IDS_MEMORYUSAGEDELTA, IDS_PAGEFAULTS,
IDS_PAGEFAULTSDELTA, IDS_VIRTUALMEMORYSIZE, IDS_PAGEDPOOL, IDS_NONPAGEDPOOL,
IDS_BASEPRIORITY, IDS_HANDLECOUNT, IDS_THREADCOUNT, IDS_USEROBJECTS, IDS_GDIOBJECTS,
IDS_IOREADS, IDS_IOWRITES, IDS_IOOTHER, IDS_IOREADBYTES, IDS_IOWRITEBYTES,
IDS_IOOTHERBYTES };
+static const int IDCValues[] = { IDC_IMAGENAME, IDC_PID, IDC_USERNAME, IDC_SESSIONID, IDC_CPUUSAGE, IDC_CPUTIME,
IDC_MEMORYUSAGE, IDC_PEAKMEMORYUSAGE, IDC_MEMORYUSAGEDELTA, IDC_PAGEFAULTS,
IDC_PAGEFAULTSDELTA, IDC_VIRTUALMEMORYSIZE, IDC_PAGEDPOOL, IDC_NONPAGEDPOOL,
IDC_BASEPRIORITY, IDC_HANDLECOUNT, IDC_THREADCOUNT, IDC_USEROBJECTS, IDC_GDIOBJECTS,
IDC_IOREADS, IDC_IOWRITES, IDC_IOOTHER, IDC_IOREADBYTES, IDC_IOWRITEBYTES,
IDC_IOOTHERBYTES };
+static BOOL *SettingsBoolPtrs[] = { &TaskManagerSettings.Column_ImageName, &TaskManagerSettings.Column_PID,
&TaskManagerSettings.Column_UserName, &TaskManagerSettings.Column_SessionID,
&TaskManagerSettings.Column_CPUUsage, &TaskManagerSettings.Column_CPUTime,
&TaskManagerSettings.Column_MemoryUsage, &TaskManagerSettings.Column_PeakMemoryUsage,
&TaskManagerSettings.Column_MemoryUsageDelta, &TaskManagerSettings.Column_PageFaults,
&TaskManagerSettings.Column_PageFaultsDelta, &TaskManagerSettings.Column_VirtualMemorySize,
&TaskManagerSettings.Column_PagedPool, &TaskManagerSettings.Column_NonPagedPool,
&TaskManagerSettings.Column_BasePriority, &TaskManagerSettings.Column_HandleCount,
&TaskManagerSettings.Column_ThreadCount, &TaskManagerSettings.Column_USERObjects,
&TaskManagerSettings.Column_GDIObjects, &TaskManagerSettings.Column_IOReads,
&TaskManagerSettings.Column_IOWrites, &TaskManagerSettings.Column_IOOther,
&TaskManagerSettings.Column_IOReadBytes, &TaskManagerSettings.Column_IOWriteBytes,
&TaskManagerSettings.Column_IOOtherBytes };
That's not really better either. All these things should be arrays, with a global enum to assign names to array entries.
On Sun, 7 Apr 2019, 12:42 am Alexandre Julliard, julliard@winehq.org wrote:
Isira Seneviratne isirasen96@gmail.com writes:
@@ -60,33 +61,48 @@ static WCHAR wszIOWriteBytes[255]; static WCHAR wszIOOtherBytes[255]; /* Column Headers; End */
+const int ColumnSizeArrayValues[] = { 105, 50, 107, 70, 35, 70, 70,
100, 70, 70, 70, 70,
70, 70, 60, 60, 60, 60, 60, 70,
70, 70, 70, 70, 70 };
+static WCHAR *wszPointers[] = { wszImageName, wszPID, wszUserName,
wszSessionID, wszCPU, wszCPUTime,
wszMemUsage, wszPeakMemUsage,
wszMemDelta, wszPageFaults, wszPFDelta,
wszVMSize, wszPagedPool, wszNPPool,
wszBasePri, wszHandles, wszThreads,
wszUSERObjects, wszGDIObjects,
wszIOReads, wszIOWrites, wszIOOther,
wszIOReadBytes, wszIOWriteBytes,
wszIOOtherBytes };
+static const int IDSValues[] = { IDS_IMAGENAME, IDS_PID, IDS_USERNAME,
IDS_SESSIONID, IDS_CPUUSAGE, IDS_CPUTIME,
IDS_MEMORYUSAGE, IDS_PEAKMEMORYUSAGE,
IDS_MEMORYUSAGEDELTA, IDS_PAGEFAULTS,
IDS_PAGEFAULTSDELTA,
IDS_VIRTUALMEMORYSIZE, IDS_PAGEDPOOL, IDS_NONPAGEDPOOL,
IDS_BASEPRIORITY, IDS_HANDLECOUNT,
IDS_THREADCOUNT, IDS_USEROBJECTS, IDS_GDIOBJECTS,
IDS_IOREADS, IDS_IOWRITES,
IDS_IOOTHER, IDS_IOREADBYTES, IDS_IOWRITEBYTES,
IDS_IOOTHERBYTES };
+static const int IDCValues[] = { IDC_IMAGENAME, IDC_PID, IDC_USERNAME,
IDC_SESSIONID, IDC_CPUUSAGE, IDC_CPUTIME,
IDC_MEMORYUSAGE, IDC_PEAKMEMORYUSAGE,
IDC_MEMORYUSAGEDELTA, IDC_PAGEFAULTS,
IDC_PAGEFAULTSDELTA,
IDC_VIRTUALMEMORYSIZE, IDC_PAGEDPOOL, IDC_NONPAGEDPOOL,
IDC_BASEPRIORITY, IDC_HANDLECOUNT,
IDC_THREADCOUNT, IDC_USEROBJECTS, IDC_GDIOBJECTS,
IDC_IOREADS, IDC_IOWRITES,
IDC_IOOTHER, IDC_IOREADBYTES, IDC_IOWRITEBYTES,
IDC_IOOTHERBYTES };
+static BOOL *SettingsBoolPtrs[] = {
&TaskManagerSettings.Column_ImageName, &TaskManagerSettings.Column_PID,
&TaskManagerSettings.Column_UserName, &TaskManagerSettings.Column_SessionID,
&TaskManagerSettings.Column_CPUUsage, &TaskManagerSettings.Column_CPUTime,
&TaskManagerSettings.Column_MemoryUsage, &TaskManagerSettings.Column_PeakMemoryUsage,
&TaskManagerSettings.Column_MemoryUsageDelta, &TaskManagerSettings.Column_PageFaults,
&TaskManagerSettings.Column_PageFaultsDelta, &TaskManagerSettings.Column_VirtualMemorySize,
&TaskManagerSettings.Column_PagedPool, &TaskManagerSettings.Column_NonPagedPool,
&TaskManagerSettings.Column_BasePriority, &TaskManagerSettings.Column_HandleCount,
&TaskManagerSettings.Column_ThreadCount, &TaskManagerSettings.Column_USERObjects,
&TaskManagerSettings.Column_GDIObjects, &TaskManagerSettings.Column_IOReads,
&TaskManagerSettings.Column_IOWrites, &TaskManagerSettings.Column_IOOther,
&TaskManagerSettings.Column_IOReadBytes, &TaskManagerSettings.Column_IOWriteBytes,
&TaskManagerSettings.Column_IOOtherBytes };
That's not really better either. All these things should be arrays, with a global enum to assign names to array entries.
-- Alexandre Julliard julliard@winehq.org
So should TASKMANAGER_SETTINGS be rewritten to include a BOOL array?
Isira Seneviratne isirasen96@gmail.com writes:
On Sun, 7 Apr 2019, 12:42 am Alexandre Julliard, julliard@winehq.org wrote:
Isira Seneviratne isirasen96@gmail.com writes:
@@ -60,33 +61,48 @@ static WCHAR wszIOWriteBytes[255]; static WCHAR wszIOOtherBytes[255]; /* Column Headers; End */
+const int ColumnSizeArrayValues[] = { 105, 50, 107, 70, 35, 70, 70, 100, 70, 70, 70, 70,
70, 70, 60, 60, 60, 60, 60, 70, 70, 70, 70, 70, 70 };
+static WCHAR *wszPointers[] = { wszImageName, wszPID, wszUserName, wszSessionID, wszCPU, wszCPUTime,
wszMemUsage, wszPeakMemUsage, wszMemDelta, wszPageFaults, wszPFDelta,
wszVMSize, wszPagedPool, wszNPPool, wszBasePri, wszHandles, wszThreads,
wszUSERObjects, wszGDIObjects, wszIOReads, wszIOWrites, wszIOOther,
wszIOReadBytes, wszIOWriteBytes, wszIOOtherBytes };
+static const int IDSValues[] = { IDS_IMAGENAME, IDS_PID, IDS_USERNAME, IDS_SESSIONID, IDS_CPUUSAGE, IDS_CPUTIME,
IDS_MEMORYUSAGE, IDS_PEAKMEMORYUSAGE, IDS_MEMORYUSAGEDELTA, IDS_PAGEFAULTS,
IDS_PAGEFAULTSDELTA, IDS_VIRTUALMEMORYSIZE, IDS_PAGEDPOOL, IDS_NONPAGEDPOOL,
IDS_BASEPRIORITY, IDS_HANDLECOUNT, IDS_THREADCOUNT, IDS_USEROBJECTS, IDS_GDIOBJECTS,
IDS_IOREADS, IDS_IOWRITES, IDS_IOOTHER, IDS_IOREADBYTES, IDS_IOWRITEBYTES,
IDS_IOOTHERBYTES };
+static const int IDCValues[] = { IDC_IMAGENAME, IDC_PID, IDC_USERNAME, IDC_SESSIONID, IDC_CPUUSAGE, IDC_CPUTIME,
IDC_MEMORYUSAGE, IDC_PEAKMEMORYUSAGE, IDC_MEMORYUSAGEDELTA, IDC_PAGEFAULTS,
IDC_PAGEFAULTSDELTA, IDC_VIRTUALMEMORYSIZE, IDC_PAGEDPOOL, IDC_NONPAGEDPOOL,
IDC_BASEPRIORITY, IDC_HANDLECOUNT, IDC_THREADCOUNT, IDC_USEROBJECTS, IDC_GDIOBJECTS,
IDC_IOREADS, IDC_IOWRITES, IDC_IOOTHER, IDC_IOREADBYTES, IDC_IOWRITEBYTES,
IDC_IOOTHERBYTES };
+static BOOL *SettingsBoolPtrs[] = { &TaskManagerSettings.Column_ImageName, &TaskManagerSettings.Column_PID,
&TaskManagerSettings.Column_UserName, &TaskManagerSettings.Column_SessionID,
&TaskManagerSettings.Column_CPUUsage, &TaskManagerSettings.Column_CPUTime,
&TaskManagerSettings.Column_MemoryUsage, &TaskManagerSettings.Column_PeakMemoryUsage,
&TaskManagerSettings.Column_MemoryUsageDelta, &TaskManagerSettings.Column_PageFaults,
&TaskManagerSettings.Column_PageFaultsDelta, &TaskManagerSettings.Column_VirtualMemorySize,
&TaskManagerSettings.Column_PagedPool, &TaskManagerSettings.Column_NonPagedPool,
&TaskManagerSettings.Column_BasePriority, &TaskManagerSettings.Column_HandleCount,
&TaskManagerSettings.Column_ThreadCount, &TaskManagerSettings.Column_USERObjects,
&TaskManagerSettings.Column_GDIObjects, &TaskManagerSettings.Column_IOReads,
&TaskManagerSettings.Column_IOWrites, &TaskManagerSettings.Column_IOOther,
&TaskManagerSettings.Column_IOReadBytes, &TaskManagerSettings.Column_IOWriteBytes,
&TaskManagerSettings.Column_IOOtherBytes };
That's not really better either. All these things should be arrays, with a global enum to assign names to array entries.
-- Alexandre Julliard julliard@winehq.org
So should TASKMANAGER_SETTINGS be rewritten to include a BOOL array?
It's probably more than a BOOL, the entire structure should be redesigned to use arrays throughout.