About WMI API and
Performance Monitor Counters
You can read
Programming Server-Side Applications for Microsoft Windows 2000
-- Jeffrey Richter, Jason D. Clark
Good luck.
Sergey Kaprov.
"Fernando Marotta" <f.ma...@NOSPAM.itsoftware.it> wrote in message
news:OMctctZiCHA.2340@tkmsftngp08...
> Hi everybody
>
> I need to write a code to monitor CPU and memory usage for a process
> (similar to the info given by task manager) in win2000.
>
> I really can't find how to do this... any idea?
>
>
> TIA
>
> Cheers
>
> Fernando
>
>
>
- For CPU usage:
SYSTEM_PROCESSOR_TIMES SysTime;
NtQuerySystemInformation( SystemProcessorTimes,
&SysTime, sizeof(SysTime), NULL );
- For Memory usage:
VM_COUNTERS VmCounters;
NtQueryInformationProcess( NtCurrentProcess(),
ProcessVmCounters,
&VmCounters, sizeof(VmCounters), NULL );
Unfortunatly I dont know exactly how to get such info for Win9x.
It works in
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
--
Andrey A. Belkin
belk...@hotmail.com
"shura" <remove-s...@paragon.ru> wrote in message
news:3DCFED8B...@paragon.ru...
"Fernando Marotta" <f.ma...@NOSPAM.itsoftware.it> wrote in message
news:OMctctZiCHA.2340@tkmsftngp08...