Tips (1541)
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 ähnlich) ShowMessage(GetProgramFilesDir); end;
Bewerten Sie diesen Tipp: