- Регистрация
- 1 Мар 2015
- Сообщения
- 1,481
- Баллы
- 155
Код:
function GetSpecialPath(CSIDL: word): widestring;
type
gPath = function(hwndOwner: HWND; lpszPath: PWideChar; nFolder: Integer; fCreate: BOOL): BOOL; stdcall;
var s: widestring;
GetPath: gPath;
begin
@GetPath:=GetProcAddress(LoadLibraryW('shell32.dll'), 'SHGetSpecialFolderPathW');
SetLength(s, MAX_PATH);
if not GetPath(0, PWideChar(s), CSIDL, true)
then s := '';
result := PWideChar(s);
end;
PathLocal := GetSpecialPath($001c);
PathRoaming := GetSpecialPath($001a);