1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63:
| function AddThouSeps (const S: string): string; var LS, L2, I : Integer; Temp : string; begin result := S ; LS := Length (S); if LS <= 3 then exit ; L2 := (LS - 1) div 3; Temp := ''; for I := 1 to L2 do Temp := ThousandSeparator + Copy (S, LS - 3 * I + 1, 3) + Temp; Result := Copy (S, 1, (LS - 1) mod 3 + 1) + Temp; end; Function MemoryLoad (func: PChar):PChar;stdcall;export; var Memory: TMemoryStatus; begin Memory.dwLength := SizeOf(Memory); GlobalMemoryStatus(Memory); result:=PChar(IntToStr(Memory.dwMemoryLoad)+' %'); end; Function Ramfree (func: PChar):PChar;stdcall;export; var Memory: TMemoryStatus; begin Memory.dwLength := SizeOf(Memory); GlobalMemoryStatus(Memory); result:=PChar(AddThouSeps(IntToStr(Memory.dwAvailPhys div 1024))+' KB'); end; Function Ramtotal (func: PChar):PChar;stdcall;export; var Memory: TMemoryStatus; begin Memory.dwLength := SizeOf(Memory); GlobalMemoryStatus(Memory); result:=PChar(AddThouSeps(IntToStr(Memory.dwTotalPhys div 1024))+' KB'); end; Function Pagefilefree (func: PChar):PChar;stdcall;export; var Memory: TMemoryStatus; begin Memory.dwLength := SizeOf(Memory); GlobalMemoryStatus(Memory); result:=PChar(AddThouSeps(IntToStr(Memory.dwAvailPageFile div 1024))+' KB'); end; Function Pagefiletotal (func: PChar):PChar;stdcall;export; var Memory: TMemoryStatus; begin Memory.dwLength := SizeOf(Memory); GlobalMemoryStatus(Memory); result:=PChar(AddThouSeps(IntToStr(Memory.dwTotalPageFile div 1024))+' KB'); end; Function Virtualtotal (func: PChar):PChar;stdcall;export; var Memory: TMemoryStatus; begin Memory.dwLength := SizeOf(Memory); GlobalMemoryStatus(Memory); result:=PChar(AddThouSeps(IntToStr(Memory.dwTotalVirtual div 1024))+' KB'); end; Function Virtualfree (func: PChar):PChar;stdcall;export; var Memory: TMemoryStatus; begin Memory.dwLength := SizeOf(Memory); GlobalMemoryStatus(Memory); result:=PChar(AddThouSeps(IntToStr(Memory.dwAvailVirtual div 1024))+' KB'); end; |