thanks i tried smething like this:
VB Code:
Do 'Create a buffer sSave = String(255, 0) 'enumerate the values If RegEnumValue(hKey, Cnt, sSave, 255, 0, ByVal 0&, ByVal 0&, ByVal 0&) <> 0 Then Exit Do strKeys(0) = "Nothing" Else ' Add the Keys to the array. ReDim Preserve strKeys(Cnt) strKeys(Cnt) = StripTerminator(sSave) Cnt = Cnt + 1 End If Loop 'Close the registry RegCloseKey hKey EnumKeyValues = strKeys
and then..
VB Code:
Dim RegArray() As String Dim intLoop As Integer RegArray = EnumKeyValues(HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run") If (RegArray(0) <> "Nothing") Then For intLoop = 0 To UBound(RegArray) List1.AddItem RegArray(intLoop) Next intLoop End If
but that still doesnt work, still gives error 9 because it doesnt set RegArray(0) to ''Nothing''




Reply With Quote