Autor Beitrag
JayK
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1013



BeitragVerfasst: Do 23.06.05 15:33 
Hallo,

wie kann ich (möglichst unkompliziert) zu einem beliebigen Schlüssel oder HKEY die Unterschlüssel auf der 1. Ebene* in einer ListBox anzeigen lassen?
Ich bitte auch um Code-Beispiele.

Schonmal Danke im vorraus,
JayK

*ich meine folgendes: Ich habe HKEY_CLASSES_ROOT am Wickel. Dieser hat einen Unterschlüssel .pas. Dieser wiederum hat noch einen Unterschlüssel Shell. Wenn ich jetzt den Inhalt von HKEY_CLASSES_ROOT in die ListBox schreiben möchte, soll .pas darin erscheinen, Shell darunter jedoch nicht.
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Do 23.06.05 16:23 
geht TRegistry.GetKeyNames(Strings: TStrings); nicht?

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
JayK Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1013



BeitragVerfasst: Do 23.06.05 16:47 
user profile iconStefanH hat folgendes geschrieben:
geht TRegistry.GetKeyNames(Strings: TStrings); nicht?

Denke schon, dass es gehen müsste, tut es jedoch nicht. Ich möchte in meinem Fall die Unteerschlüssel von HKEY_CLASSES_ROOT auflisten lassen.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
FileTypeList: TListBox;

procedure TForm1.bLoadClick (Sender: TObject );
var
  reg: TRegistry;
begin
  reg := TRegistry.Create;
  try
    with reg do
      begin
      RootKey := HKEY_CLASSES_ROOT;
      GetKeyNames(FileTypeList.Items);
      end;
   finally
     reg.Free;
   end;
end;
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Do 23.06.05 16:51 
bau noch ein OpenKey('', false); ein... dann gehts :P

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
JayK Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1013



BeitragVerfasst: Do 23.06.05 19:30 
user profile iconStefanH hat folgendes geschrieben:
bau noch ein OpenKey('', false); ein... dann gehts :P

Die bescheuerte Runtime-Exception Box hat folgendes geschrieben:
Project project 1 raised exception class 'External: SISSEGV'.
:autsch: :evil: :motz: Kann denn nicht auch nur einmal etwas funktionieren hier?!!
HINWEIS: Dieses Gefluche gilt nicht irgendwelchen Usern des Delphi-Forums oder anderen humanoiden Lebewesen. :)
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Do 23.06.05 19:33 
hm.. bei mir geht das:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.bLoadClick (Sender: TObject );
var
  reg: TRegistry;
begin
  reg := TRegistry.Create;
  try
    with reg do
      begin
      RootKey := HKEY_CLASSES_ROOT;
      OpenKey('', false);
      GetKeyNames(FileTypeList.Items);
      end;
   finally
     reg.Free;
   end;
end;


:?!?:

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
JayK Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1013



BeitragVerfasst: Do 23.06.05 19:36 
genau so hab ich es da stehen... :nixweiss: :?!?: