urivera
asked on
How to get (iterate) through the subkeys in the registry
Hello,
I need to know how to iterate or get the names of subkeys located in a specific location in the registry. For example, I created several keys in the software folder in the registry under HKEY_CURRENT_USER
SOFTWARE\\MycompanyName\\M yCompanySo ftwareName \\SavedSet tings\\
I created the MyCompanyName, MyCompanySoftwareName, SavedSettings keys, under the SavedSettings I will also create other keys, I need a way to go through all the keys in under SavedSettings so I can display the name of the keys in a listbox control in a dialog.
I need to know how to iterate or get the names of subkeys located in a specific location in the registry. For example, I created several keys in the software folder in the registry under HKEY_CURRENT_USER
SOFTWARE\\MycompanyName\\M
I created the MyCompanyName, MyCompanySoftwareName, SavedSettings keys, under the SavedSettings I will also create other keys, I need a way to go through all the keys in under SavedSettings so I can display the name of the keys in a listbox control in a dialog.
See RegEnumKeyEx function.
ASKER
Any way of using CRegKey instead? I saw on msdn that there is a EnumKey method but when try to use it compiler complains it can't find the method, although it can find open, create, and other methods. I wanted to use a CRegKey object because I already started using it in the code.
HI Univera
CRegKey doesn't provide support for Enumerating the Key,but you can use Registry handle from CRegKey object to enum key using RegEnumKey(...) api.
if you like ,i can post a samll example dealing with both!!!!
CRegKey doesn't provide support for Enumerating the Key,but you can use Registry handle from CRegKey object to enum key using RegEnumKey(...) api.
if you like ,i can post a samll example dealing with both!!!!
ASKER
Hi Cool_alok,
Can you please post an example?
thanks
Can you please post an example?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.