Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi HKEY und String was tuen ? (https://www.delphipraxis.net/49036-hkey-und-string-tuen.html)

Jarmen_Kell 4. Jul 2005 20:47

Re: HKEY und String was tuen ?
 
Oder einfach

Delphi-Quellcode:
uses Registry

var
  Reg:TRegistry;
  s:String;

...

  Reg:=TRegistry.Create;
  Reg.RootKey:=HKEY_LOCAL_MACHINE;
  Reg.OpenKey('Software/meinekeys',false) //false = bei nicht-existenz NICHT erstellen
  s:=Reg.ReadString('wert1')

agm65 6. Jul 2005 06:10

Re: HKEY und String was tuen ?
 
sorry leute hatte eben erst zeit eure post anzuschauen ...1a !

Delphi-Quellcode:
function StrToHKEY(Key: string): HKEY;
begin
  if Key = 'HKEY_CURRENT_USER' then Result := HKEY_CURRENT_USER;
  //...usw
end;
das ist es....einfach und schnell.....10000000 DANKE

MisterNiceGuy 27. Jan 2010 14:32

Re: HKEY und String was tuen ?
 
Für alle die die gegenteilige Funktion interessiert:

Delphi-Quellcode:
function TForm1.hkeytostr(rootkey:hkey):string;
begin
  case rootkey of
    HKEY_CLASSES_ROOT : result := 'HKEY_CLASSES_ROOT';
    HKEY_CURRENT_USER : result := 'HKEY_CURRENT_USER';
    HKEY_LOCAL_MACHINE : result := 'HKEY_LOCAL_MACHINE';
    HKEY_USERS : result := 'HKEY_USERS';
    HKEY_CURRENT_CONFIG : result := 'HKEY_CURRENT_CONFIG';
  end;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:10 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz