|
-
Aug 30th, 2000, 03:11 PM
#1
Thread Starter
New Member
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
-
Aug 30th, 2000, 04:39 PM
#2
Hyperactive Member
I dont know if it will work in NT:
Code:
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
WP
-
Aug 30th, 2000, 05:18 PM
#3
Thread Starter
New Member
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
-
Aug 30th, 2000, 05:27 PM
#4
Hyperactive Member
PS if you want to write code, use the functions (thea will be more surveyable
WP
-
Aug 30th, 2000, 05:42 PM
#5
Hyperactive Member
to post code:
[code] Your code goes here... [/code]
-
Aug 30th, 2000, 06:41 PM
#6
Lively Member
nice
Nice. I've never come across that function before 
Later
REM
"Innovate, don't immitate."
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
|