Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. System Admin
  4. Getting the current CPU load ???

Getting the current CPU load ???

Scheduled Pinned Locked Moved System Admin
question
4 Posts 2 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Brian van der Beek
    wrote on last edited by
    #1

    Is it possible to get the current CPU load/usage just as in the TaskManager ?

    L 1 Reply Last reply
    0
    • B Brian van der Beek

      Is it possible to get the current CPU load/usage just as in the TaskManager ?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      In regsistry there is a hidden branch - hkey_perfomance_data. Just read key values from it

      B 1 Reply Last reply
      0
      • L Lost User

        In regsistry there is a hidden branch - hkey_perfomance_data. Just read key values from it

        B Offline
        B Offline
        Brian van der Beek
        wrote on last edited by
        #3

        Thanx. But how do you read/view hidden keys ?

        L 1 Reply Last reply
        0
        • B Brian van der Beek

          Thanx. But how do you read/view hidden keys ?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Try sth like this below: HKEY hKey = 0; TCHAR vendorData [64]; DWORD data = 0; DWORD dataSize = 0; LONG result = ::RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Hardware\\Description\\System\\CentralProcessor\\0"), 0, KEY_QUERY_VALUE, &hKey); if(result == ERROR_SUCCESS) { //get Mhz: result = ::RegQueryValueEx(hKey, _T("~MHz"), NULL, NULL,(LPBYTE)&data, &dataSize); if(result == ERROR_SUCCESS) PROCESSOR IS data MHZ else IT IS UNKNOWN (fe: W9X) //get the vendor data: dataSize = sizeof (vendorData); result = ::RegQueryValueEx(hKey, _T("VendorIdentifier"), NULL, NULL, (LPBYTE)vendorData, &dataSize); } RegCloseKey (hKey); The above code works for me, but only on NT systems.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups