Nice of you to disappear on IRC whenever I try to help you.
Strict
Extern "Win32"
Function GlobalMemoryStatus( buffer:Byte Ptr )
End Extern
'' Memory structure containing the amounts of memory available IN BYTES
'' For some reaosn or other, the page file size is reported as negative on my PC
'' So if you (for some inane reason) want the size of the page file, you may have
'' to do some digging to find out what's up
Type MEMORYSTATUS Final
Rem
DWORD dwLength;
DWORD dwMemoryLoad;
SIZE_T dwTotalPhys;
SIZE_T dwAvailPhys;
SIZE_T dwTotalPageFile;
SIZE_T dwAvailPageFile;
SIZE_T dwTotalVirtual;
SIZE_T dwAvailVirtual;
End Rem
Field dwLength
Field dwMemoryLoad
Field dwTotalPhys
Field dwAvailPhys
Field dwTotalPageFile
Field dwAvailPageFile
Field dwTotalVirtual
Field dwAvailVirtual
Method New( )
GlobalMemoryStatus( Varptr Self.dwLength )
If Self.dwLength <> 32 Then Throw "MEMORYSTATUS.dwLength <> 32"
End Method
End Type
'' TEST CODE
Local i:MEMORYSTATUS = New MEMORYSTATUS
Print "Structure Size: "+i.dwLength
Print "Memory Load: "+i.dwMemoryLoad+"b"
Print "Total Physical: "+i.dwTotalPhys+"b"
Print "Available Physical: "+i.dwAvailPhys+"b"
Print "Total Page File: "+i.dwTotalPageFile+"b"
Print "Available Page File: "+i.dwAvailPageFile+"b"
Print "Total Virtual: "+i.dwTotalVirtual+"b"
Print "Available Virtual: "+i.dwAvailVirtual+"b"
Input
|