1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
function memDispo : DWORD; // renvoie mem vive dispo
var Mem : TMemoryStatus;
begin Mem.dwLength:=SizeOf(TMemoryStatus); GlobalMemoryStatus(Mem);
memDispo:=Mem.dwAvailPhys;
end; // Pour plus de détails voir 'MemoryStatus' dans l''aide SDKWindows
function fGoMoKo(const mem : DWord) : string; // pour afficher une taille en DWord via la string-Result au format raccourci
var e : byte; s : string; r : Extended;
begin e:=0; r:=mem;
if r>=0 then
begin while r>1024 do begin r:=r/1024; inc(e); end;
case e of
0 : s:='Oct';
1 : s:='Ko';
2 : s:='Mo';
3 : s:='Go';
4 : s:='To';
end;
fGoMoKo:=FormatFloat('#.###',r)+' '+s;
end;
end; // fGoMoKo |
Partager