|
-
Feb 17th, 2000, 11:06 AM
#5
Paste this into a modul :
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
Const fmt As String = "###,###,###,###"
Const skb As String = " Kbyte"
Const nkb As Long = 1024
Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)
Function GetRAM() As String
Dim MS As MEMORYSTATUS
MS.dwLength = Len(MS)
GlobalMemoryStatus MS
GetRAM = Format$(MS.dwTotalPhys / nkb, fmt) & skb
End Function
Function GetAviableRam() As String
Dim MS As MEMORYSTATUS
MS.dwLength = Len(MS)
GlobalMemoryStatus MS
tmp = MS.dwTotalPhys / 100
a = MS.dwAvailPhys / tmp
a = 100 - a
a = Int(a)
GetAvRam = Format$(MS.dwAvailPhys / nkb, fmt) & skb & " [" & a & " % used]"
End Function
Function GetPageFile() As String
Dim MS As MEMORYSTATUS
MS.dwLength = Len(MS)
GlobalMemoryStatus MS
GetPF = Format$(MS.dwTotalPageFile / nkb, fmt) & skb
End Function
Function GetAviablePageFile() As String
Dim MS As MEMORYSTATUS
MS.dwLength = Len(MS)
GlobalMemoryStatus MS
tmp = MS.dwTotalPageFile / 100
a = MS.dwAvailPageFile / tmp
a = 100 - a
GetFreePF = Format$(MS.dwAvailPageFile / nkb, fmt) & skb & " [" & Format$(a, fmt) & " % used]"
End Function
---------------------------
hope that helps....
[This message has been edited by taLON (edited 02-17-2000).]
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
|