Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
500MB 27GB Web Hosting - $9.95/Month
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleGet system memory information
Keywordsmemory, system memory, resources
CategoriesUtilities, Windows
 
Use the GlobalMemoryStatus API function.
 
Private Sub ShowStatistics()
Dim mem As MEMORYSTATUS
Dim txt As String

    GlobalMemoryStatus mem

    With mem
        txt = txt & "% used:                " & _
            Format$(.dwMemoryLoad, "@@@@@@@@@@@") & vbCrLf
        txt = txt & "Total physical memory: " & _
            Format$(.dwTotalPhys, "@@@@@@@@@@@") & vbCrLf
        txt = txt & "Physical memory free:  " & _
            Format$(.dwAvailPhys, "@@@@@@@@@@@") & vbCrLf
        txt = txt & "Total page file size:  " & _
            Format$(.dwTotalPageFile, "@@@@@@@@@@@") & _
            vbCrLf
        txt = txt & "Free page file size:   " & _
            Format$(.dwAvailPageFile, "@@@@@@@@@@@") & _
            vbCrLf
        txt = txt & "Total virtual memory:  " & _
            Format$(.dwTotalVirtual, "@@@@@@@@@@@") & vbCrLf
        txt = txt & "Free virtual memory:   " & _
            Format$(.dwAvailVirtual, "@@@@@@@@@@@") & vbCrLf
    End With

    Label1.Caption = txt
End Sub
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated