Specialised task manager
-
I was thinking of creating a simple, specialised task manager. It seems quite easy to use the Diagnostics.Process class to get processes memory and CPU usage. But I also need to get GDI and USER objects per process. Is there any similar class for that or is it performance counters or WMI I need to look into?
-
I was thinking of creating a simple, specialised task manager. It seems quite easy to use the Diagnostics.Process class to get processes memory and CPU usage. But I also need to get GDI and USER objects per process. Is there any similar class for that or is it performance counters or WMI I need to look into?
clatten wrote: Is there any similar class for that or is it performance counters or WMI I need to look into? Yes, you do need to use performance counters for this. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]
-
clatten wrote: Is there any similar class for that or is it performance counters or WMI I need to look into? Yes, you do need to use performance counters for this. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]
Hi Heath, thanks for your answer. I did look into the performance objects in PerfMon (I have a XP Home WS at home and a Win2K WS at work) and could not find any counters for the process object. Actually I could not find any counter for this. I have looked with exctrlst.exe and could not find any disabled counters. So I have to ask if you can point me in the right direction on how to proceed: 1. Do I have to do something to add more counters to the process object (or they might just not are available in WS PerfMon). 2. Is there any other performance object I should look into (but I still want the count per process as in the Task manager).
-
Hi Heath, thanks for your answer. I did look into the performance objects in PerfMon (I have a XP Home WS at home and a Win2K WS at work) and could not find any counters for the process object. Actually I could not find any counter for this. I have looked with exctrlst.exe and could not find any disabled counters. So I have to ask if you can point me in the right direction on how to proceed: 1. Do I have to do something to add more counters to the process object (or they might just not are available in WS PerfMon). 2. Is there any other performance object I should look into (but I still want the count per process as in the Task manager).
If you can't find performance counters that suit your needs, you'll need to P/Invoke native APIs when appropriate, like
GetPerformanceInfo
orGetProcessMemoryInfo
, both defined in psapi.dll on XP and newer. I recommend reading the native performance monitoring and Processes sections of the Platform SDK at http://msdn.microsoft.com/library[^]. The .NET BCL by no means provides a full set of diagnostic APIs for issues like this. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog] -
If you can't find performance counters that suit your needs, you'll need to P/Invoke native APIs when appropriate, like
GetPerformanceInfo
orGetProcessMemoryInfo
, both defined in psapi.dll on XP and newer. I recommend reading the native performance monitoring and Processes sections of the Platform SDK at http://msdn.microsoft.com/library[^]. The .NET BCL by no means provides a full set of diagnostic APIs for issues like this. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]