searching for a key in visual basic

I'm trying to use visual basic to serarch for a speific key in the registry. I know it rewuires the use of an API call but I can't find one that does what I would like it to do.
jardoomanAsked:
Who is Participating?
 
cookreConnect With a Mentor Commented:
That's why you have to walk the registry tree, recursively calling RegEnumKeyEx on each sub-key.

something like this:
bool EnumNode(HKEY KeyToDo)
{
idx=0;
rc = RegEnumKeyEx(KeyToDo,idx,...);
while (rc==ERROR_SUCCESS)
        {
        if (this is the one you're looking for)
           {
           do something
           return true;
           }
        Open this subkey
        if (EnumNode(thissubkey))  {close subkey; return true;)
        close subkey
        idx+=1;
        }

}
0
 
cookreCommented:
The API call to use is RegEnumKeyEx.  Here's a sample:
http://www.estescentral.net/Documentation/api/ref/r/regenumkeyex.html
0
 
Mayank SAssociate Director - Product EngineeringCommented:
If you are on VB .NET, then you can use the RegistryKey class.
0
 
jardoomanAuthor Commented:
I am familiar with the regenumkey but I can only get it to go in one level. The key I'm trying to find is within a folder that I may not always know the name of.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.