如何获得特定进程(比如一个打开的notepad)的cpu使用率??

解决方案 »

  1.   

    是使用得百分比,不是cpu时间
      

  2.   

    我用这个方法得到的是0,
    PerformanceCounter^ PC = gcnew PerformanceCounter;
    PC->CategoryName = "Process";
    PC->CounterName = "% Processor Time";
    PC->InstanceName = "Idle";
    printf("sdfas:%s" ,PC->RawValue.NextValue().ToString() );
    能给我下具体的代码吗?
      

  3.   

    可以参考:http://www.vckbase.com/sourcecode/system/
      

  4.   

    "ntdll.dll" 
    "NtQuerySystemInformation"