Howdy, Stranger!

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

Categories

how to get system information??

grahamojgrahamoj Member Posts: 366
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

  • zenboyzenboy Member Posts: 26
    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);



  • grahamojgrahamoj Member Posts: 366
    : 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.
  • zenboyzenboy Member Posts: 26
  • grahamojgrahamoj Member Posts: 366
    :
    :
    where could i also get info on about what hardware is installed on a computer to display it??

    thanks,
    grahamoj.
  • Andre YoungAndre Young USAMember Posts: 0

    _ // http://forcoder.org // free ebooks and video tutorials about // Ruby R Java Go Visual Basic .NET Swift C++ MATLAB Delphi Visual Basic C Assembly PHP Objective-C Python C# Scratch Perl JavaScript PL/SQL Crystal Scala Lisp Hack Bash Dart F# Transact-SQL Kotlin SAS VBScript Erlang Logo LabVIEW Clojure Rust ABAP Apex ML Julia Ada FoxPro COBOL Awk D Scheme Alice Lua Fortran Prolog // ___________

Sign In or Register to comment.