-
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
-
Check the MSDN at www.msdn.microsoft.com and search for base services as well as the registry Win32 API calls.
-
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