I would like to load into a array (or listbox) all the sub-keys of a registry key.
For example:
I would use HKEY_CLASSES_ROOT\.bmp\ and it would load all subkeys like ShellNew, OpenWithList, etc. The I would like to be able to get the default value of HKEY_CLASSES_ROOT\.bmp\ShellNew .
If this sounds confusing, tell me and I'll try to explain better.
The EnumRegKey function of the attached module returns all the sub keys of the key specified. There are commented examples of each function that you can modify to your needs.
This module is just a slight rework of one that lordrat posted.
Since I not really sure if you are trying to get all the values of a key or all the sub keys of a key, I'm showing you both. I would guess this should also work with VB5.
For this example place 2 listboxes on the form and add this code. I have given you examples that should probably produce results on your machine and I have also written in (and commented) what I think you may be looking for.
VB Code:
Option Explicit
Private Sub Form_Load()
Dim RegArray() As String
Dim intLoop As Integer
On Error Resume Next ' in case the array returns nothing