Получить путь к директории Program Files
Оформил: DeeCo
Автор: http://www.swissdelphicenter.ch
uses
Registry;
function GetProgramFilesDir: string;
var
reg: TRegistry;
begin
reg := TRegistry.Create;
try
reg.RootKey := HKEY_LOCAL_MACHINE;
reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion', False);
Result := reg.ReadString('ProgramFilesDir');
finally
reg.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
// Shows something like c:\Program files
// zeigt "c:\Programme" (oder ahnlich)
ShowMessage(GetProgramFilesDir);
end;
|