1,184
社区成员




type
LPMEMORYSTATUSEX=^TMemoryStatusEx;
TMemoryStatusEx = record
dwLength: DWORD;
dwMemoryLoad: DWORD;
ullTotalPhys: Int64;
ullAvailPhys: Int64;
ullTotalPageFile: Int64;
ullAvailPageFile: Int64;
ullTotalVirtual: Int64;
ullAvailVirtual: Int64;
ullAvailExtendedVirtual: Int64;
end;
function GlobalMemoryStatusEx(const ApMemoryStatusEx : LPMEMORYSTATUSEX) : LongBool; stdcall; external 'kernel32.dll';
procedure GetPhysMemory(var PhysMem:String);
var
statex:TMEMORYSTATUSEX;
begin
try
statex.dwLength := sizeof (statex);
GlobalMemoryStatusEx (@statex);
PhysMem:=FormatFloat('#,###', statex.ullTotalPhys/1024.0)+'KB';
finally
end;
end;