VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



gives the memory status of your system

by Vineeth Venugopal (7 Submissions)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 9th June 2008
Date Added: Mon 8th February 2021
Rating: (1 Votes)

gives the memory status of your system

API Declarations


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


Rate gives the memory status of your system



Private Sub command1_click()
   Dim MS As MEMORYSTATUS
   MS.dwLength = Len(MS)
   GlobalMemoryStatus MS
   Dim msg$
   msg = "MEMORY STATUS" + vbCrLf
   msg = msg + "============================" + vbCrLf
   msg = msg + "Loaded memory = " + Format$(MS.dwMemoryLoad, "###,###,###,###") + " % used" + vbCrLf
   msg = msg + "--------------------------------" + vbCrLf
   msg = msg + "Physical memory = " + Format$(MS.dwTotalPhys / 1024, "###,###,###,###") + " Kb" + vbCrLf
   msg = msg + "Free Physical memory = " + Format$(MS.dwAvailPhys / 1024, "###,###,###,###") + " Kb" + vbCrLf
   msg = msg + "--------------------------------" + vbCrLf
   msg = msg + "Paging file = " + Format$(MS.dwTotalPageFile / 1024, "###,###,###,###") + " Kb" + vbCrLf
   msg = msg + "Free Paging file = " + Format$(MS.dwAvailPageFile / 1024, "###,###,###,###") + " Kb" + vbCrLf
   msg = msg + "--------------------------------" + vbCrLf
   msg = msg + "Virtual memory : " + Format$(MS.dwTotalVirtual / 1024, "###,###,###,###") + " Kb" + vbCrLf
   msg = msg + "Free Virtual memory = " + Format$(MS.dwAvailVirtual / 1024, "###,###,###,###") + " Kb"
MsgBox msg
End Sub





Download this snippet    Add to My Saved Code

gives the memory status of your system Comments

No comments have been posted about gives the memory status of your system. Why not be the first to post a comment about gives the memory status of your system.

Post your comment

Subject:
Message:
0/1000 characters