Results 1 to 6 of 6

Thread: Detect microprocessor and RAM

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    France
    Posts
    51

    Question Detect microprocessor and RAM

    Hello

    How can we detect which processor and how many RAM are included inside the PC (for example : Pentium II 233 MHz, 64 Mb of RAM) ?

    Thank you in advance for your help.

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Try the GetSystemInfo API Function:
    Code:
    Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)
    Private Type SYSTEM_INFO
        dwOemID As Long
        dwPageSize As Long
        lpMinimumApplicationAddress As Long
        lpMaximumApplicationAddress As Long
        dwActiveProcessorMask As Long
        dwNumberOrfProcessors As Long
        dwProcessorType As Long
        dwAllocationGranularity As Long
        dwReserved As Long
    End Type
    Private Sub Form_Load()
        Dim SInfo As SYSTEM_INFO
        'Set the graphical mode to persistent
        Me.AutoRedraw = True
        'Get the system information
        GetSystemInfo SInfo
        'Print it to the form
        Me.Print "Number of procesor:" + str$(SInfo.dwNumberOrfProcessors)
        Me.Print "Processor:" + str$(SInfo.dwProcessorType)
        Me.Print "Low memory address:" + str$(SInfo.lpMinimumApplicationAddress)
        Me.Print "High memory address:" + str$(SInfo.lpMaximumApplicationAddress)
    End Sub
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    France
    Posts
    51

    Arrow Detect processor in MHz and RAM in Mb

    Thank you !

    But I need :

    Microprocessor : the rated in MHz.
    RAM : the memory in Méga Bytes.


    Thank you in advance for your answer.

  4. #4
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    It is very easy to get the ammount of RAM:
    Code:
    Private Type MEMORYSTATUS
        dwLength As Long
        dwMemoryLoad As Long
        dwTotalPhys As Long
        dwAvailPhys As Long
        dwTotalPageFile As Long
        dwAvailPageFile As Long
        dwTotalVirtual As Long
        dwAvailVirtual As Long
    End Type
    Private Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)
    Private Sub Form_Load()
    Dim MemStat As MEMORYSTATUS
        'retrieve the memory status
        GlobalMemoryStatus MemStat
        MsgBox "You have" + Str$(MemStat.dwTotalPhys / 1024) + " Kb total memory and" + Str$(MemStat.dwAvailPageFile / 1024) + " Kb available PageFile memory."
    End Sub
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    France
    Posts
    51

    Exclamation Get processor rate

    Many thanks

    What about the processor rate (I need this info such as 233 MHz for example).

    Thank you again.

  6. #6
    Addicted Member csammis's Avatar
    Join Date
    Mar 2001
    Location
    /dev/null
    Posts
    226
    I've got a lot of [frustrating] experience with this, and in VB there's only one way to get the processor mHz, and it *only* works in Windows NT and 2000.

    The processor info is stored in the registry:
    HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0

    From there, you can get info like mHz. You can't get something like "Pentium II", but the Family/Model/Stepping information is there, and there's a way to figure out what processor type it is from that, but I never found a reliable way.
    Things I've Said:
    "Life's funny like that...elephants can wear frilly lace panties, and Dubya still looks like a monkey in a big chair"
    "Take four goats and strap one to each foot of a llama. Presto, goat-powered llama!"
    "You want to get me to work more, get me a Coke. No? Then deal with inferior garbage, I'm not coding another line and your clients can go to......thanks, I'd love a Coke right about now!"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width