Как найти каталог Windows

Как найти каталог Windows

function GetWindowsFolder:string;
{©Drkb v.3(2007): <a href="http://www.drkb.ru" title="www.drkb.ru">www.drkb.ru</a>,
 ®Vit (Vitaly Nevzorov) - nevzorov@yahoo.com}

var p:PChar;
begin
 GetMem(p, MAX_PATH);
 result:='';
 if GetWindowsDirectory(p, MAX_PATH)>0 then
  result:=string(p);
 FreeMem(p);
end;
Автор: Vit (www.delphist.com, www.drkb.ru, www.unihighlighter.com, www.nevzorov.org)

public
 { Public declarations }
 Windir: string;
 WindirP: PChar;
 Res: Cardinal;
procedure TForm1.Button1Click(Sender: TObject);
begin
 WinDirP := StrAlloc(MAX_PATH);
 Res := GetWindowsDirectory(WinDirP, MAX_PATH);
 if Res > 0 then
  WinDir := StrPas(WinDirP);
 Label1.Caption := WinDir;
end;
http://delphiworld.narod.ru/ DelphiWorld 6.0

Отправить комментарий

Проверка
Антиспам проверка
Image CAPTCHA
...