how to get system information??

hiya is there a class in c++ or mfc to get the computers system information, so i can display it..

if not, how can i do this??

thanks,
grahamoj.

Comments

  • Hope this is what your looking for : )

    /////////////////////////////////////////////////////
    // ** getting system info

    TCHAR szBuffer[256];
    DWORD dwSize = 256;

    // ** retrieve the computer name from windows
    GetComputerName(szBuffer, &dwSize);

    // ** set string
    CString strComputerName;
    strComputerName = szBuffer;

    // ** allocate structure to recieve memory status
    MEMORYSTATUS mem_stat;

    // ** retrieve the current memory status
    GlobalMemoryStatus(&mem_stat);

    // ** set up variables
    CString strTotalMemory;
    CString strFreeMemory;
    CString strMemoryLoad;

    // ** transfer the memory details to appropriate variables
    strTotalMemory.Format("%ld KB", mem_stat.dwTotalPhys / 1024);
    strFreeMemory.Format("%ld KB", mem_stat.dwAvailPhys / 1024);
    strMemoryLoad.Format("%d %%", mem_stat.dwMemoryLoad);



  • : Hope this is what your looking for : )
    :
    : /////////////////////////////////////////////////////
    : // ** getting system info
    :
    : TCHAR szBuffer[256];
    : DWORD dwSize = 256;
    :
    : // ** retrieve the computer name from windows
    : GetComputerName(szBuffer, &dwSize);
    :
    : // ** set string
    : CString strComputerName;
    : strComputerName = szBuffer;
    :
    : // ** allocate structure to recieve memory status
    : MEMORYSTATUS mem_stat;
    :
    : // ** retrieve the current memory status
    : GlobalMemoryStatus(&mem_stat);
    :
    : // ** set up variables
    : CString strTotalMemory;
    : CString strFreeMemory;
    : CString strMemoryLoad;
    :
    : // ** transfer the memory details to appropriate variables
    : strTotalMemory.Format("%ld KB", mem_stat.dwTotalPhys / 1024);
    : strFreeMemory.Format("%ld KB", mem_stat.dwAvailPhys / 1024);
    : strMemoryLoad.Format("%d %%", mem_stat.dwMemoryLoad);
    :
    :
    :
    :
    hiya thanks for that. exactly what i wanted. found other structures i can use too..

    grahamoj.
  • :
    :
    where could i also get info on about what hardware is installed on a computer to display it??

    thanks,
    grahamoj.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories