|
-
Aug 9th, 2000, 10:34 PM
#1
Thread Starter
Member
How can I have a dialog box display the users available memory?
Thanks
-
Aug 11th, 2000, 02:34 PM
#2
Fanatic Member
maybe the GlobalMemoryStatusEx function, see http://www.vbapi.com Will post some code in a little while,
-
Aug 11th, 2000, 02:52 PM
#3
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|