Thread: retrieve computer info

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    1

    retrieve computer info

    hello,

    i was wondering, where to gather the pc info..
    i'm fairly new to c++, only make console applications at the moment..experiment with things a lot

    now i thought, it would be nice if i make something, that shows the info of my pc. Like the processor/cpu, ram, what removeble drives are in my pc and stuff like that. Maybe even what os i'm running. It is probably stored by windows somewhere, but i have no clue where to go look for it, maybe some info on that, and to read the specific file where it's stored, how can that be done best.

    Best regards

  2. #2
    Master of the Universe! velius's Avatar
    Join Date
    Sep 2003
    Posts
    219
    Check the MSDN at www.msdn.microsoft.com and search for base services as well as the registry Win32 API calls.
    While you're breakin' down my back n'
    I been rackin' out my brain
    It don't matter how we make it
    'Cause it always ends the same
    You can push it for more mileage
    But your flaps r' wearin' thin
    And I could sleep on it 'til mornin'
    But this nightmare never ends
    Don't forget to call my lawyers
    With ridiculous demands
    An you can take the pity so far
    But it's more than I can stand
    'Cause this couchtrip's gettin' older
    Tell me how long has it been
    'Cause 5 years is forever
    An you haven't grown up yet
    -- You Could Be Mine - Guns N' Roses

  3. #3
    Normal vector Carlos's Avatar
    Join Date
    Sep 2001
    Location
    Budapest
    Posts
    463
    GetSystemInfo (declared in windows.h) might be helpful:

    Code:
    VOID GetSystemInfo(
      LPSYSTEM_INFO lpSystemInfo  // system information
    );
    
    where LPSYSTEM_INFO points to following struct
    
    typedef struct _SYSTEM_INFO { 
      union { 
        DWORD  dwOemId; 
        struct { 
          WORD wProcessorArchitecture; 
          WORD wReserved; 
        }; 
      }; 
      DWORD  dwPageSize; 
      LPVOID lpMinimumApplicationAddress; 
      LPVOID lpMaximumApplicationAddress; 
      DWORD_PTR dwActiveProcessorMask; 
      DWORD dwNumberOfProcessors; 
      DWORD dwProcessorType; 
      DWORD dwAllocationGranularity; 
      WORD wProcessorLevel; 
      WORD wProcessorRevision; 
    } SYSTEM_INFO;
    Furthermore perform a search for "Getting Hardware Information" on msdn.
    There are also several related projects with source code on
    www.codeproject.com

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Unlocking my computer
    By LuckY in forum Tech Board
    Replies: 20
    Last Post: 03-31-2004, 01:28 PM
  2. Computer Problems
    By fac7 in forum Tech Board
    Replies: 13
    Last Post: 03-23-2004, 01:22 AM
  3. Binary trees search problem...
    By Umoniel in forum C Programming
    Replies: 2
    Last Post: 02-22-2004, 02:29 PM
  4. How to retrieve video hardware info
    By MrGrieves in forum Windows Programming
    Replies: 7
    Last Post: 08-01-2002, 01:22 PM
  5. "Stips" on computer? (a boring story)
    By napkin111 in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 05-22-2002, 07:26 AM