CodedK
asked on
How can i enumerate all subfolders of a folder in registry in TreeView.
Hi.
The title is self-explanatory.
I need to list in a treeview the subfolders (not the subfolders of the subfolders (Depth=1)) of a path in registry.
Example : ( List SubFolders of HKEY_USERS\Default )
-------------------------- ---------- ------
HKEY Users
|->Default
|-> AppEvents
|-> Console
|-> Control Panel
|-> EHelp
|-> Environment
-------------------------- ---------- ------
Thanks in advance :)
The title is self-explanatory.
I need to list in a treeview the subfolders (not the subfolders of the subfolders (Depth=1)) of a path in registry.
Example : ( List SubFolders of HKEY_USERS\Default )
--------------------------
HKEY Users
|->Default
|-> AppEvents
|-> Console
|-> Control Panel
|-> EHelp
|-> Environment
--------------------------
Thanks in advance :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
After retrieving the list to stringlist you can simply check / search into it.
e..g
s.IndexOf('2'); // will return the index if found -1 otherwise.
OR
var
Reg : TRegistry;
begin
Reg := TRegistry.Create;
Reg.RootKey := HKEY_USERS;
Reg.OpenKey('.DEFAULT', False);
if Reg.KeyExists('2') then
ShowMesasage('The key exists');
Reg.Free;
end;
e..g
s.IndexOf('2'); // will return the index if found -1 otherwise.
OR
var
Reg : TRegistry;
begin
Reg := TRegistry.Create;
Reg.RootKey := HKEY_USERS;
Reg.OpenKey('.DEFAULT', False);
if Reg.KeyExists('2') then
ShowMesasage('The key exists');
Reg.Free;
end;
ASKER
Thanks :)
I'll split the points if you dont mind...
I'll split the points if you dont mind...
That's fine.
ASKER
Ciuly how can i insert those values to an allready existing item in the treeview ?
TreeView1.Items.Addchild(e
ASKER
Well if itsnt too much to ask do you know how can i filter those subfolders and list only those...
if they contain a subfolder named "2" ?