Quote:
>Does anybody know how to display the "Physical Memory Available to Windows"
>(like if you clicked on the about button in Notepad) in my App. I want the
>percentage on a label. I only want that, not the System Information
Put the following declarations in the General Declarations section of a form:
Private Declare Sub GlobalMemoryStatus Lib "kernel32" _
(lpBuffer As MEMORYSTATUS)
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
Code to get memory numbers:
Dim uMemsts As MEMORYSTATUS
GlobalMemoryStatus uMemsts
Me.Print "Total Physical Memory: " & CStr(uMemsts.dwTotalPhys)
Me.Print "Total Available Memory: " & CStr(uMemsts.dwAvailPhys)
Lee Weiner
weiner AT fuse DOT net
http://home.fuse.net/lweiner