Results 1 to 2 of 2

Thread: System Resources

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Columbus Ohio
    Posts
    217
    Is there an API call to return the amount of system resources free/used etc?
    Chris

    [email protected]
    Windows XP RC2 B2526
    Visual Studio.Net Beta 2
    C++, VB, VB.Net, ASP, PHP

  2. #2
    New Member
    Join Date
    Aug 2000
    Posts
    7
    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
  •  



Click Here to Expand Forum to Full Width