Looking for a way to find out how much available RAM is left on system or how much is being used in NT.
Thanks,
John
Printable View
Looking for a way to find out how much available RAM is left on system or how much is being used in NT.
Thanks,
John
I dont know if it will work in NT:
WPCode:Private Declare Sub GlobalMemoryStatus Lib "Kernel32" (lpBuffer As MEMORYSTATUS)
Type MEMORYSTATUS
dwLength As Long ' sizeof(MEMORYSTATUS)
dwMemoryLoad As Long ' percent of memory in use
dwTotalPhys As Long ' bytes of physical memory
dwAvailPhys As Long ' free physical memory bytes
dwTotalPageFile As Long ' bytes of paging file
dwAvailPageFile As Long ' free bytes of paging file
dwTotalVirtual As Long ' user bytes of address space
dwAvailVirtual As Long ' free user bytes
End Type
Public MemInfo As MEMORYSTATUS
Private Sub Command1.Click()
MemInfo.dwLength = Len(MemInfo)
Call GlobalMemoryStatus(MemInfo)
MsgBox MemInfo.dwAvailPhys
End Sub
Worked fine thanks a lot just changed one thing to private.
Private Declare Sub GlobalMemoryStatus Lib "Kernel32" (lpBuffer As MEMORYSTATUS)
Private Type MEMORYSTATUS
dwLength As Long ' sizeof(MEMORYSTATUS)
dwMemoryLoad As Long ' percent of memory in use
dwTotalPhys As Long ' bytes of physical memory
dwAvailPhys As Long ' free physical memory bytes
dwTotalPageFile As Long ' bytes of paging file
dwAvailPageFile As Long ' free bytes of paging file
dwTotalVirtual As Long ' user bytes of address space
dwAvailVirtual As Long ' free user bytes
End Type
Dim MemInfo As MEMORYSTATUS
Private Sub Command1_Click()
MemInfo.dwLength = Len(MemInfo)
Call GlobalMemoryStatus(MemInfo)
MsgBox MemInfo.dwAvailPhys
End Sub
PS if you want to write code, use thefunctions (thea will be more surveyableCode:&
WP
to post code:
[code] Your code goes here... [/code]
Nice. I've never come across that function before :)
Later
REM