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:
| function GetWinDir: String; const UNLEN = MAX_PATH; var Size: DWORD; begin Size := UNLEN + 1; SetLength (Result, Size); if GetWindowsDirectory (PChar (Result), Size) <> 0 then SetLength (Result, StrLen (PChar (Result))) else Result := ''; end;
function GetSysDir: String; const UNLEN = MAX_PATH; var Size: DWORD; begin Size := UNLEN + 1; SetLength (Result, Size); if GetSystemDirectory (PChar (Result), Size) <> 0 then SetLength (Result, StrLen (PChar (Result))) else Result := ''; end; |