CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: Query CPU usage

  1. #1
    Join Date
    Apr 2004
    Posts
    5

    Query CPU usage

    Is there any other way to query the CPU usage other than using RegQueryValueEx?This is creating lots of problems....

  2. #2
    Join Date
    Sep 2002
    Posts
    924
    What kind of problems?

  3. #3
    Join Date
    Oct 1999
    Location
    India
    Posts
    35
    You can also get CUP usage using PDH counters. MSDN describes how to use PDH.

    Hope this helps.

    Thanks
    -- Kedar

  4. #4
    Join Date
    Apr 2004
    Posts
    5
    Thanks..
    but iam facing a new problem now,,,,iam not able to c "processor" object in my perfmon..is there anyway by using PDH..i can programatically do it....

  5. #5
    Join Date
    May 2004
    Posts
    2
    The wmi interface provides access to all the performance counters.

    A search on the microsoft web site will provide lots of doc as well as sample c++ code.

  6. #6
    Join Date
    May 2002
    Posts
    52
    On win2k and XP the processor object might be disabled.
    Enable it by modifying the registry:
    HKEY_LOCAL_MACHIN\SYSTEM\CurrentControlSet\Services\PerfOS\Performance. Set "Disable Performance Counters" to 0.

  7. #7
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    Take a look at the following thread...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured