Быстрые функции для получения путей до папок

function GetWindowsDirectoryP: string;
begin
    SetLength(Result, MAX_PATH);
    SetLength(Result, GetWindowsDirectory(@Result[1], Length(Result)));
end;
unit Winapi.ShlObj;
function GetUserProfile: string;
var buffer: array[0..MAX_PATH] of Char;
begin
    Result := '';
    if Succeeded( SHGetFolderPath(0, CSIDL_PROFILE, 0, 0, buffer)) then
        Result := StrPas(buffer);
end;
unit Winapi.ShlObj;
function GetUserProfile: string;
var buffer: array[0..MAX_PATH] of Char;
begin
    Result := '';
    if Succeeded( SHGetFolderPath(0, CSIDL_DESKTOP, 0, 0, buffer)) then
        Result := StrPas(buffer);
end;
  • works/programmer/delphi/path-quick.txt
  • Последнее изменение: 2018/12/15 17:18
  • 127.0.0.1