Does anyone know how to monitor the cpu usage of a process or thread? I think it has something to do with certain entries in the registry being modified by the system in real time, but I couldn't find those entries on my computer.
Printable View
Does anyone know how to monitor the cpu usage of a process or thread? I think it has something to do with certain entries in the registry being modified by the system in real time, but I couldn't find those entries on my computer.
Forget the registry! :)
Take a look at this function:
If you want other processs information, perhaps these functions are of interest:Code:BOOL GetProcessTimes(
HANDLE hProcess, // handle to process
LPFILETIME lpCreationTime, // process creation time
LPFILETIME lpExitTime, // process exit time
LPFILETIME lpKernelTime, // process kernel-mode time
LPFILETIME lpUserTime // process user-mode time
);
Code:BOOL GetProcessIoCounters(
HANDLE hProcess, // handle to process
PIO_COUNTERS lpIoCounters // I/O accouting information
);
BOOL GetProcessMemoryInfo(
HANDLE Process, // handle to process
PPROCESS_MEMORY_COUNTERS ppsmemCounters, // buffer
DWORD cb // size of buffer
);