|
-
Aug 29th, 2000, 09:49 AM
#1
Thread Starter
Addicted Member
Is there an API call to return the amount of system resources free/used etc?
-
Aug 29th, 2000, 11:08 AM
#2
New Member
this code (from the vb world library) will show
various bits of memory information, if that is what you are after.
Option Explicit
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
Private Declare Sub GlobalMemoryStatus Lib "kernel32" _
(lpBuffer As MEMORYSTATUS)
Const fmt As String = "###,###,###,###"
Const skb As String = " Kbyte"
Const nkb As Long = 1024
Private Sub Form_Load()
Dim MS As MEMORYSTATUS
MS.dwLength = Len(MS)
GlobalMemoryStatus MS
lbMemStat(0) = Format$(MS.dwMemoryLoad, fmt) & " % used"
lbMemStat(1) = Format$(MS.dwTotalPhys / nkb, fmt) & skb
lbMemStat(2) = Format$(MS.dwAvailPhys / nkb, fmt) & skb
lbMemStat(3) = Format$(MS.dwTotalPageFile / nkb, fmt) & skb
lbMemStat(4) = Format$(MS.dwAvailPageFile / nkb, fmt) & skb
lbMemStat(5) = Format$(MS.dwTotalVirtual / nkb, fmt) & skb
lbMemStat(6) = Format$(MS.dwAvailVirtual / nkb, fmt) & skb
End Sub
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
|