Results 1 to 3 of 3

Thread: SysMemory in dialogs

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2000
    Posts
    37
    How can I have a dialog box display the users available memory?

    Thanks

  2. #2
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    maybe the GlobalMemoryStatusEx function, see http://www.vbapi.com Will post some code in a little while,

  3. #3
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    Use the GlobalMemoryStatus, unless more than 4GB!!! of RAM!!!!, then use Ex
    Code:
    'in a module
    Public Declare Sub GlobalMemoryStatus Lib "kernel32" Alias "GlobalMemoryStatus" (lpBuffer As MEMORYSTATUS)
    Public 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
    
    
    Public Sub GetMemory()
    ' Display the amounts of total and available physical memory
    ' on the computer.  Also calculate the percentage of used physical memory.
    Dim ms As MEMORYSTATUS
    
    ' Get the current memory status.
    GlobalMemoryStatus ms
    ' Display total and available physical memory, in KB.
    Debug.Print "Total Physical Memory:"; ms.dwTotalPhys \ 1024; "KB"
    Debug.Print "Available Physical Memory:"; ms.dwAvailPhys \ 1024; "KB"
    ' Calculate percentage of physical memory in use.
    Debug.Print "Used Physical Memory:"; 100 - 100 * ms.dwAvailPhys \ ms.dwTotalPhys; "%"
    end sub
    
    'usage
    GetMemory
    i found this at http://www.vbapi.com

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