none
Where can I find? RRS feed

  • Question

  • Can someone tell me where I can find the answers to:

    1. Installed Memory?

    2. CPU Speed?

    I would really appreciate it a lot. Thank You.

    I have Win XP with 2nd DL (I forget what it is called)

    Monday, May 17, 2010 5:14 AM

Answers

  • Memory: GlobalMemoryStatusExullTotalPhys member of MEMORYSTATUSEX struct.

    CPU speed:

    HKEY hKey = NULL;
    if (RegOpenKey(HKEY_LOCAL_MACHINE, L"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", &hKey) == ERROR_SUCCESS)
    {
    	wchar_t sMHz[10];
    	DWORD dwMHz = 0;
    	DWORD dwBufferSize = sizeof(dwMHz);
    	if (RegQueryValueEx(hKey, L"~MHz", NULL, NULL, (LPBYTE)&dwMHz, &dwBufferSize) == ERROR_SUCCESS)
    	{
    		swprintf(sMHz, 10, L"%u", dwMHz);
    		wcout << sMHz << endl;
    	}
    	RegCloseKey(hKey);
    }


    Nikita Leontiev
    • Proposed as answer by Nancy Shao Tuesday, May 18, 2010 9:24 AM
    • Marked as answer by Nancy Shao Tuesday, May 25, 2010 10:00 AM
    Monday, May 17, 2010 10:33 AM