Obtain system information

Source: Internet
Author: User

In the registry, HKEY_LOCAL_MACHINE \ HARDWARE \ DESCRIPTION \ System \ CentralProcessor \ 0 \ ProcessorNameString and ~ The MHz field describes the CPU string and clock speed. You can use the read registry function to read the information.

Obtain the number of CPU cores:

Mainly related to the following system structures

Typedef struct _ SYSTEM_INFO {
Union {
DWORD dwOemId;
Struct {
WORD wProcessorArchitecture;
WORD wReserved;
};
};
DWORD dwPageSize;
LPVOID lpMinimumApplicationAddress;
LPVOID lpMaximumApplicationAddress;
DWORD_PTR dwActiveProcessorMask;
DWORD dwNumberOfProcessors; // number of kernels
DWORD dwProcessorType;
DWORD dwAllocationGranularity;
WORD wProcessorLevel;
WORD wProcessorRevision;} SYSTEM_INFO;

Use the GlobalSystemInfo function to directly obtain

2. Memory Information

Mainly related to the following system structures

Typedef struct _ MEMORYSTATUS {
DWORD dwLength; // The length of the structure.
DWORD dwMemoryLoad ;//
SIZE_T dwTotalPhys; // total memory size (memory)
SIZE_T dwAvailPhys; // excluding the current system, the remaining idle memory
SIZE_T dwTotalPageFile;
SIZE_T dwAvailPageFile;
SIZE_T dwTotalVirtual;
SIZE_T dwAvailVirtual;} MEMORYSTATUS,
* LPMEMORYSTATUS;

Use GlobalMemoryStatus to directly obtain

3. Operating System Information

Mainly related to the following system structures

Typedef struct _ OSVERSIONINFO {
DWORD dwOSVersionInfoSize; // structure Length
DWORD dwMajorVersion; // master version
DWORD dwMinorVersion; // minor version
DWORD dwBuildNumber; // creation number
DWORD dwPlatformId; // 2: winnt 1: win9x
TCHAR szCSDVersion [128];} OSVERSIONINFO;

Typedef struct _ OSVERSIONINFOEX {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
TCHAR szCSDVersion [128]; // service number string
WORD wServicePackMajor; // master service number
WORD wServicePackMinor; // service number
WORD wSuiteMask; // software set mask
BYTE wProductType; // product type (server, workstation, Domain Controller)
BYTE wReserved;} OSVERSIONINFOEX,
* POSVERSIONINFOEX,
* LPOSVERSIONINFOEX;

Get it directly using GetVersionEx

4. system running time

Use the dword winapi GetTickCount (void) function to obtain the number of milliseconds that the system has started running until now.

5. System Directory

Use the GetSystemDirectory function to obtain

6. System Language

Use the GetSystemDefaultLangID (void) function to obtain the language ID.

General Value

{0x0401, "Arabic (Saudi Arabia )"},
{0x0801, "Arabic (Iraq )"},
{0x0c01, "Arabic (Egypt )"},
{0x1001, "Arabic (Libya )"},
{0x1401, "Arabic (Algeria )"},
{0x1801, "Arabic (Morocco )"},
{0x1c01, "Arabic (Tunisia )"},
{0x2001, "Arabic (Oman )"},
{0x2401, "Arabic (Yemen )"},
{0x2801, "Arabic (Syria )"},
{0x2c01, "Arabic (Jordan )"},
{0x3001, "Arabic (Lebanon )"},
{0x3401, "Arabic (Kuwait )"},
{0x3801, "Arabic (U. A. E .)"},
{0x3c01, "Arabic (Bahrain )"},
{0x4001, "Arabic (Qatar )"},
{0x0402, "Bulgarian "},
{0x0403, "Catalan "},
{0x0404, "Chinese (Taiwan Region, PRC )"},
{0x0804, "Chinese (PRC )"},
{0x0c04, "Chinese (Hong Kong SAR, PRC )"},
{0x1004, "Chinese (Singapore, PRC )"},
{0x0405, "Czech "},
{0x0406, "Danish "},
{0x0407, "German (Standard )"},
{0x0807, "German (Swiss )"},
{0x0c07, "German (Austrian )"},
{0x1007, "German (Luxembourg )"},
{0x1407, "German (Liechtenstein )"},
{0x0408, "Greek "},
{0x0409, "English (United States )"},
{0x0809, "English (United Kingdom )"},
{0x0c09, "English (English )"},
{0x1009, "English (Canadian )"},
{0x1409, "English (New Zealand )"},
{0x1809, "English (Ireland )"},
{0x1c09, "English (South Africa )"},
{0x2009, "English (Jamaica )"},
{0x2409, "English (Caribbean )"},
{0x2809, "English (Belize )"},
{0x2c09, "English (Trinidad )"},
{0x040a, "Spanish (Traditional Sort )"},
{0x080a, "Spanish (Mexican )"},
{0x0c0a, "Spanish (Modern Sort )"},
{0x100a, "Spanish (Guatemala )"},
{0x140a, "Spanish (Costa Rica )"},
{0x180a, "Spanish (Panama )"},
{0x1c0a, "Spanish (Dominican Republic )"},
{0x200a, "Spanish (Venezuela )"},
{0x240a, "Spanish (Colombia )"},
{0x280a, "Spanish (Peru )"},
{0x2c0a, "Spanish (Argentina )"},
{0x300a, "Spanish (Ecuador )"},
{0x340a, "Spanish (Chile )"},
{0x0000a, "Spanish (Uruguay )"},
{0x3c0a, "Spanish (Paraguay )"},
{0x400a, "Spanish (Bolivia )"},
{0x0000a, "Spanish (El Salvador )"},
{0x480a, "Spanish (Honduras )"},
{0x4c0a, "Spanish (Nicaragua )"},
{0x500a, "Spanish (Puerto Rico )"},
{0x040b, "Finnish "},
{0x040c, "French (Standard )"},
{0x080c, "French (Belgian )"},
{0x0c0c, "French (Canadian )"},
{0x100c, "French (Swiss )"},
{0x140c, "French (Luxembourg )"},
{0x040d, "Hebrew "},
{0x040e, "Hungarian "},
{0x040f, "Icelandic "},
{0x0410, "Italian (Standard )"},
{0x0810, "Italian (Swiss )"},
{0x0411, "Japan "},
{0x0412, "Korean "},
{0x0812, "Korean (Johab )"},
{0x0413, "Dutch (Standard )"},
{0x0813, "Dutch (Belgian )"},
{0x0414, "Norwegian (Bokmal )"},
{0x0814, "Norwegian (Nynorsk )"},
{0x0415, "Polish "},
{0x0416, "Portuguese (radiilian )"},
{0x0816, "Portuguese (Standard )"},
{0x0418, "Romanian "},
{0x0419, "Russian "},
{0x041a, "Croatian "},
{0x081a, "Serbian (Latin )"},
{0x0c1a, "Serbian (Cyrillic )"},
{0x041b, "Slovak "},
{0x041c, "Albanian "},
{0x041d, "Swedish "},
{0x081d, "Swedish (Finland )"},
{0x041e, "Thai "},
{0x041f, "Turkish "},
{0x0421, "Indonesian "},
{0x0422, "Ukrainian "},
{0x0423, "Belarusian "},
{0x0424, "Slovenian "},
{0x0425, "Estonian "},
{0x0426, "Latvian "},
{0x0427, "Lithuanian "},
{0x0429, "Farsi "},
& Nbs

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.