Visual Basic provides us a function called GetAllSettings which can be used to return the Registry entries for a particular Appname and Setting. Here's the format for the GetAllSettings function. This is used for example in case we loose track of the entries we have made in the windows registry.
Syntax
GetAllSettings(appname, section)
The GetAllSettings function syntax has these named arguments:
Part Description
appname Required String expression containing the name of the application orproject whose key settings are requested.
section Required String expression containing the name of the section whose key settings are requested. GetAllSettings returns aVariant whose contents is a two-dimensional array of strings containing all the key settings in the specified section and their corresponding values.
Once GetAllSettings executes and returns a two dimensional array, we can use the Lbound and Ubound functions, in conjunction with a For-Next Loop to move through the elements of the Array and display them as shown in the code below
vb Code:
Private Sub Command2_Click()
Dim MyAppSettings As Variant, i As Long
MyAppSettings = GetAllSettings("MyApp", "Startup")
'~~> Loop through the array
For i = LBound(MyAppSettings, 1) To UBound(MyAppSettings, 1)
'~~> Display the values in the array
MsgBox MyAppSettings(i, 0), MyAppSettings(i, 1)
Next i
End Sub