Click here to Skip to main content
12,454,965 members (62,467 online)
Click here to Skip to main content
Add your own
alternative version

Stats

366.3K views
15.3K downloads
149 bookmarked
Posted

System Information

, 19 Aug 2003
Rate this:
Please Sign up or sign in to vote.
Obtaining Information from Computer Hardware/Software
<!-- Article image -->

Screen shot of program

<!-- Add the rest of your HTML here -->

Introduction

This program shows you a very simple way to determine your PC hardware and software. It queries operating system for the following Hardware/Software:

  • Operating System Version (Thanks to PJ Naughter)
  • Computer Name
  • IP Address of Computer
  • User Name
  • Internet Explorer Version
  • Total RAM
  • Free Memory
  • Number of Hard Disk Drives
  • Hard Disk Total Space/Free Space/Used Space
  • CDROM Drives
  • Monitor Resolution
  • Color Depth
  • Number of CPUs (Thanks to Iain Chesworth)
  • CPU Speed
  • CPU Identifier
  • CPU Vendor Identifier
  • Operating System Folder
  • System Folder

Program structure

By clicking the combo box and changing it's item, selected item is determined and it's ID passed to Process member function of dialog. The Process member function takes ID of query and returns the proper result. Body of Process has a lot of code to prepares result and if any error has occurred, the error string will be returned.

How to use

Add the following header and implementation files to your project:
  • cup_info.h, cpu_info.cpp: For CPU Information like Speed, ID, Vendor ID,...
  • dtwinver.h, dtwinver.cpp: For Operating System Version (e.g. Build Number and Service Packs)
  • SysInfoDefs.h, SysInfoDefs.cpp: For General System Information like Total RAM, Number of Hard Disk Drives, Disk Space/Free Space/Used Space
  • SmartDef.h: For IDE S.M.A.R.T. commands to query from IDE hard disks that support SMART.

Functions

Below table shows all functions that are used to determine Hardware/Software of the computer.

CString DetermineIEVer(); Determining Internet Explorer Version (Build Number)
CString QueryHardDisks(); Calculating Number of Hard Disks and Number of Cylinders, Tracks per Cylinders, Sectors per Tracks, Bytes per Sector and Total Capacity for each Hard Disks
CString QueryDriveSpace(); Calculating Drive Space/Free Space/Used Space of All Hard Drives
CString QueryCDDrive(); Determining Number of CD Drives
CString QueryTotalRAM() Calculating Total Physical RAM (Random Access Memory)
CString QueryFreeRAM(); Calculating Free Physical Memory
CString QueryUserName() User Name of current user
CString QueryComputerName(); Computer Name
CString QueryCPUInfo(); Number of CPU Installed on Mother Board
CString QueryCPUSpeed(); Speed of each CPU
CString QueryCPUID(); ID of each CPU
CString QueryCPUVendorID(); ID of CPU Vendor
CString QueryResolution(); Calculating Monitor Resolution in Pixel
CString QueryPixelDepth(); Calculating Color Depth of any Pixel
CString QueryOS(); Determining Operating System Version (Build Number) and it's Service Pack
CString QueryLocalIPAddress(); Determining IP Address of Computer
CString QueryHDDSmartCommand(); Query IDE hard disks that support SMART (Self-Monitoring Analysis & Reporting Technology).
CString QueryDirectory(char* sFolder,int iFolder); Determining Full Path of Specified Folder where sFolder is Folder Name and iFolder is Folder Shell ID Number
CString GetCommandError(); Determining last occurred error

Requirements

  • Latest Platform SDK
  • Visual Studio 6.0 with service pack 5

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

A. Riazi
CEO Misbah3Com
Iran (Islamic Republic of) Iran (Islamic Republic of)
I was born in Shiraz, a very beautiful famous city in Iran. I started programming when I was 12 years old with GWBASIC. Since now, I worked with various programming languages from Basic, Foxpro, C/C++, Visual Basic, Pascal to MATLAB and now Visual C++.
I graduated from Iran University of Science & Technology in Communication Eng., and now work as a system programmer for a telecommunication industry.
I wrote several programs and drivers for Synthesizers, Power Amplifiers, GPIB, GPS devices, Radio cards, Data Acqusition cards and so many related devices.
I'm author of several books like Learning C (primary and advanced), Learning Visual Basic, API application for VB, Teach Yourself Object Oriented Programming (OOP) and etc.
I'm winner of January, May, August 2003 and April 2005 best article of month competetion, my articles are:

You can see list of my articles, by clicking here


You may also be interested in...

Pro
Pro

Comments and Discussions

 
SuggestionMessage Automatically Removed Pin
15-May-14 6:57
memberkamleshgs15-May-14 6:57 
Questionget hardware information Pin
Member 1009957710-Jun-13 4:59
memberMember 1009957710-Jun-13 4:59 
QuestionThank You Pin
adam-master5-Mar-13 23:56
memberadam-master5-Mar-13 23:56 
GeneralMy vote of 5 Pin
manoj kumar choubey26-Feb-12 19:55
membermanoj kumar choubey26-Feb-12 19:55 
GeneralExcuseme Help me! Pin
sincr61323-Apr-11 20:56
membersincr61323-Apr-11 20:56 
GeneralMy vote of 1 Pin
Ali Saeedi12-May-10 1:38
memberAli Saeedi12-May-10 1:38 
GeneralLittle mistake. Pin
Member 284418815-Jul-08 2:18
memberMember 284418815-Jul-08 2:18 
QuestionClass CPUInfo do not support Chip intel ? Pin
To Quang Hiep5-May-08 3:18
memberTo Quang Hiep5-May-08 3:18 
Questionhellp me plz Pin
lays18-Apr-08 23:13
memberlays18-Apr-08 23:13 
Questionhelp me Pin
lays14-Apr-08 20:32
memberlays14-Apr-08 20:32 
Questionhelp Pin
lays8-Apr-08 8:38
memberlays8-Apr-08 8:38 
AnswerRe: help [modified] Pin
vv3g20-May-10 17:28
membervv3g20-May-10 17:28 
GeneralYour source is very valueble to me! Pin
Ingenious00128-Mar-07 1:39
memberIngenious00128-Mar-07 1:39 
GeneralRe: Your source is very valueble to me! Pin
A. Riazi30-Mar-07 0:57
memberA. Riazi30-Mar-07 0:57 
GeneralRe: Your source is very valueble to me! Pin
Ingenious0013-Apr-07 3:01
memberIngenious0013-Apr-07 3:01 
GeneralRe: Your source is very valueble to me! Pin
Rarencjusz10-Jun-07 23:48
memberRarencjusz10-Jun-07 23:48 
GeneralCreating a new partition Pin
Member #389306511-Mar-07 21:11
memberMember #389306511-Mar-07 21:11 
QuestionHard Disk's Physical Information Pin
Member #38930656-Mar-07 0:34
memberMember #38930656-Mar-07 0:34 
QuestionUnable to download the source Pin
Nanda Kishore_SGS29-Oct-06 22:43
memberNanda Kishore_SGS29-Oct-06 22:43 
QuestionSCSI S.M.A.R.T. info? Pin
silikon25-Oct-06 5:39
membersilikon25-Oct-06 5:39 
QuestionAMD 64 Pin
Raul Simcic6-Aug-06 22:54
memberRaul Simcic6-Aug-06 22:54 
AnswerRe: AMD 64 Pin
A. Riazi6-Aug-06 23:52
memberA. Riazi6-Aug-06 23:52 
GeneralERROR_INSUFFICIENT_BUFFER Pin
Randor30-May-06 17:40
memberRandor30-May-06 17:40 
QuestionCan you help me. Pin
terahez11-Apr-06 0:32
memberterahez11-Apr-06 0:32 
AnswerRe: Can you help me. Pin
A. Riazi11-Apr-06 8:43
memberA. Riazi11-Apr-06 8:43 
GeneralRe: Can you help me. Pin
terahez11-Apr-06 22:12
memberterahez11-Apr-06 22:12 
GeneralRe: Can you help me. Pin
A. Riazi11-Apr-06 22:22
memberA. Riazi11-Apr-06 22:22 
GeneralRe: Can you help me. Pin
icsvoice1-May-06 5:21
membericsvoice1-May-06 5:21 
GeneralHard Drive Serial Number Pin
abubakar_noman5-Mar-06 3:32
memberabubakar_noman5-Mar-06 3:32 
Generalcompilation error Pin
chunnu_8017-Jan-06 4:39
memberchunnu_8017-Jan-06 4:39 
GeneralSmall mistake for Total memory Pin
cpsworld11-Jan-06 7:08
membercpsworld11-Jan-06 7:08 
GeneralRe: Small mistake for Total memory Pin
A. Riazi12-Jan-06 0:10
memberA. Riazi12-Jan-06 0:10 
GeneralHarddisk and drive name Pin
ugur_basak23-Nov-05 20:56
memberugur_basak23-Nov-05 20:56 
GeneralRe: Harddisk and drive name Pin
ugur_basak23-Nov-05 21:57
memberugur_basak23-Nov-05 21:57 
GeneralMemory Leak detected Pin
Juri Barthel24-Jun-05 1:05
memberJuri Barthel24-Jun-05 1:05 
GeneralRe: Memory Leak detected Pin
A. Riazi24-Jun-05 1:13
memberA. Riazi24-Jun-05 1:13 
GeneralMore features Pin
Hachaso30-May-05 1:09
memberHachaso30-May-05 1:09 
GeneralStructure misalignment Pin
smedlytonker21-Feb-05 9:06
membersmedlytonker21-Feb-05 9:06 
Generallots of compile errors Pin
polunga25-Jan-05 19:06
memberpolunga25-Jan-05 19:06 
GeneralRe: lots of compile errors Pin
A. Riazi25-Jan-05 19:48
memberA. Riazi25-Jan-05 19:48 
Generalwindows xp Pin
strugglingCoder6-Jan-05 18:50
memberstrugglingCoder6-Jan-05 18:50 
GeneralRe: windows xp Pin
A. Riazi6-Jan-05 20:10
memberA. Riazi6-Jan-05 20:10 
GeneralRe: windows xp Pin
strugglingCoder11-Jan-05 10:30
memberstrugglingCoder11-Jan-05 10:30 
GeneralRe: windows xp Pin
A. Riazi11-Jan-05 19:01
memberA. Riazi11-Jan-05 19:01 
QuestionHow to get centrino cpu speed correctly? Pin
wx2a819-Oct-04 11:36
susswx2a819-Oct-04 11:36 
AnswerRe: How to get centrino cpu speed correctly? Pin
Ing-Long Eric Kuo6-Dec-04 23:44
memberIng-Long Eric Kuo6-Dec-04 23:44 
GeneralSlight error and missing SMART infos Pin
Raul Sobon12-Oct-04 15:26
memberRaul Sobon12-Oct-04 15:26 
GeneralRe: Slight error and missing SMART infos Pin
A. Riazi12-Oct-04 21:06
memberA. Riazi12-Oct-04 21:06 
GeneralRe: Slight error and missing SMART infos Pin
Orkblutt28-Sep-05 18:09
memberOrkblutt28-Sep-05 18:09 
GeneralRe: Slight error and missing SMART infos Pin
A. Riazi28-Sep-05 19:59
memberA. Riazi28-Sep-05 19:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160826.1 | Last Updated 20 Aug 2003
Article Copyright 2003 by A. Riazi
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid