Как получить путь к директории Windows?
function TForm1.GettingWinDirectory: string;
var
Size: Cardinal;
pStr: PChar;
begin
pStr := nil;
Size := MAX_COMPUTERNAME_LENGTH + 1;
try
pStr := StrAlloc( Size );
GetWindowsDirectory( pStr, Size );
Result := pStr;
finally
if pStr <> nil then StrDispose( pStr );
end;
end; |