|
On mouse click ,i would like to get the data for memory space used & free,individual drive memory space,operating system used etc details.how to write the code for this retrival?
|
|
|
by using win32 api 'GlobalMemoryStatus'
I hope the folowing code will give you some help
.....
Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As _
MemoryStatus)
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 Sub Form_MouseClick()
Dim ms As MemoryStatus
ms.dwLength = Len(ms)
GlobalMemoryStatus ms
MsgBox "Total physical memory: " & Format(ms.dwTotalPhys, _
"##,##0") & vbCr & "Available physical memory: " & _
Format(ms.dwAvailPhys, "##,##0") & vbCr & "Memory load: " & _
Format(ms.dwMemoryLoad, "##,##0"), vbInformation, _
"Free Memory"
End Sub
|
|
|
|
|
|
|
// |