Autor Beitrag
Minime
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Di 24.10.06 15:43 
jo also man sieht doch immer wenn man mit RegEdit "surft" und dabei einen pfad anklickt IMMER
den Key "(Standard)"

der hat auf meinem PC einen wert und ich möchte das gerne auslesen

leider bekomme ich das mit Registry.pas oder MiniReg.pas nicht hin
die sagen immer nur das sein kein wert vorhanden
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Di 24.10.06 15:56 
user profile iconMinime hat folgendes geschrieben:
leider bekomme ich das mit Registry.pas oder MiniReg.pas nicht hin

Dir jetzt etwas fertiges zu schreiben ist doof - deshalb zeig mal etwas Sourcecode bei dem es nicht funktioniert. ;-)

_________________
Ein Nutzer der Ecke ;-)
Minime Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Di 24.10.06 16:01 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.Button1Click(Sender: TObject);
var s:string; keys:TstringList;
begin
keys := tstringLIst.Create;
RegEnumKEys(HKEY_LOCAL_MACHINE,'SOFTWARE\Electronic Arts\EA Games\Battlefield 1942\ergc',s);
keys.Text := s;
showmessage(keys.text);
end;


ergc hat den wert den ich will (laut regedit) ist aber irgendwie ein pfad mit wert ??!!
Ergebniss -> leere Showmessage

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.Button1Click(Sender: TObject);
var s:string; keys:TstringList;
begin
keys := tstringLIst.Create;
RegGetString(HKEY_LOCAL_MACHINE,'SOFTWARE\Electronic Arts\EA Games\Battlefield 1942\ergc',s);
keys.Text := s;
showmessage(keys.text);
end;


genauso leere showmeessage
Minime Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Di 24.10.06 16:08 
lol mir ist das voll egal mit was ich das hinbekomme ich will nur wissen wie ich den Wert auslesen kann
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Di 24.10.06 16:09 
Gibt es einen Grund warum du nicht die TRegistry Klasse verwendest?

Hier ein Beispiel:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
uses
  Registry;

procedure TForm1.Button1Click(Sender: TObject);
var
  s: string; 
  Reg: TRegistry;
begin
  Reg := TRegistry.Create;
  try
    Reg.RootKey := HKEY_LOCAL_MACHINE;
    if Reg.OpenKey('\SOFTWARE\Electronic Arts\EA Games\Battlefield 1942\ergc', False) then
    begin
      s := Reg.ReadString('');
      Reg.CloseKey;
    end;
  finally
    Reg.Free;
  end;  

  showmessage (s);
end;

_________________
Ein Nutzer der Ecke ;-)
Minime Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Di 24.10.06 16:16 
ja weil die mein programm um satte 80kb größer macht
im mom bin ich bei 17 kb ^^


thnx

mhh was ich nicht vertehe ist wie man den wert eines "value" ausließt der sleber gar keine bezeichnung hat