Home All Groups Group Topic Archive Search About

Programmatically Find All Registry Entries

Author
11 Oct 2006 9:49 PM
eSolTec, Inc. 501(c)(3)
Thank you in advance for any and all assistance, it is GREATLY appreciated.
I'm wondering if there is a way to duplicate a function in regedit of find
and find next for keywords programmatically, then to list them in a treeview
or listbox?

If so, could someone point me to some code?
--
Michael Bragg, President
eSolTec, Inc.
a 501(C)(3) organization
MS Authorized MAR
looking for used laptops for developmentally disabled.

Author
11 Oct 2006 11:00 PM
Mythran
Show quote Hide quote
"eSolTec, Inc. 501(c)(3)" <esoltec@noemail.nospam> wrote in message
news:7DD3F544-EB8C-4D50-8811-2A6679EB63B5@microsoft.com...
> Thank you in advance for any and all assistance, it is GREATLY
> appreciated.
> I'm wondering if there is a way to duplicate a function in regedit of find
> and find next for keywords programmatically, then to list them in a
> treeview
> or listbox?
>
> If so, could someone point me to some code?
> --
> Michael Bragg, President
> eSolTec, Inc.
> a 501(C)(3) organization
> MS Authorized MAR
> looking for used laptops for developmentally disabled.

You should be able to build one yourself using the Microsoft.Win32 namespace
(notibly, the Registry classes).

HTH,
Mythran
Author
12 Oct 2006 1:02 AM
GhostInAK
Hello eSolTec, Inc. 501(c)(3),

Geez.  Is there anything you know how to do yourself?  It would save us all
a great amount of time if you just asked someone to write your app for you.

-Boo

Show quoteHide quote
> Thank you in advance for any and all assistance, it is GREATLY
> appreciated. I'm wondering if there is a way to duplicate a function
> in regedit of find and find next for keywords programmatically, then
> to list them in a treeview or listbox?
>
> If so, could someone point me to some code?
>
Author
12 Oct 2006 6:57 AM
Gary Chang[MSFT]
Hi Michael,

>I'm wondering if there is a way to duplicate a function in regedit
>of find and find next for keywords programmatically, then to list
>them in a treeview or listbox?

I am afraid there hasn't been a sample by hand to do this, the general
approach is to enumerate all the registry keys/subkys and their values for
the target data you want to find.

You can use the RegistryKey.GetSubKeyNames to enumerate a specific key
(e.g. HKCU), then enumerate each of its subkey recursively. Once you get a
leaf subkey (which hasn't its own subkeys), you can use the
RegistryKey.GetValueNames to get all of its value names and then use the
RegistryKey.GetValue to retrieve their values.

The following MSDN documentation contains the code snippets on using the
above FCL methods:

RegistryKey.GetSubKeyNames Method
http://msdn2.microsoft.com/en-us/library/microsoft.win32.registrykey.getsubk
eynames.aspx

RegistryKey.GetValueNames Method 
http://msdn2.microsoft.com/en-us/library/microsoft.win32.registrykey.getvalu
enames.aspx


By the way, if you are not very familiar about how to populate a treeview
control in VB.NET, you can refer to the following samples:

http://abstractvb.com/code.asp?A=967

http://www.startvbdotnet.com/controls/treeview.aspx


I hope the above information helps, if you have any questions or concerns,
please do not hesitate to let me know. I am standing by to help you.

Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.