I want to determine Hardware information like CPU, RAM, Hard Disk, GPU, etc. My application is in C++ but is built on Qt. How to get this information? Thank You.
EDIT: Looks like there is no platform independent way for this. So please can you list the code for prominent OS like Windows, OSX & Ubuntu?
EDIT: I am talking about basic information like processor speed, amount of RAM available, hard disk speed, GPU speed & memory.
MS provides some functions to look up these informations programmatically (include Windows.h):
BOOL WINAPI GetPhysicallyInstalledSystemMemory( _Out_ PULONGLONG TotalMemoryInKilobytes );
Retrieves informations about the RAM, see documentation.
BOOL WINAPI GetDiskFreeSpaceEx(
_In_opt_ LPCTSTR lpDirectoryName,
_Out_opt_ PULARGE_INTEGER lpFreeBytesAvailable,
_Out_opt_ PULARGE_INTEGER lpTotalNumberOfBytes,
_Out_opt_ PULARGE_INTEGER lpTotalNumberOfFreeBytes
);
Retrieves information about the amount of space that is available on a disk volume, see documentation.
SYSTEM_INFO siSysInfo;
// Copy the hardware information to the SYSTEM_INFO structure.
GetSystemInfo(&siSysInfo);
Contains information about the current computer system. This includes the architecture and type of the processor, the number of processors in the system, the page size, and other such information, see this MS site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With