Visual Basic - URGENTEEEE: Claves de registro

Life is soft - evento anual de software empresarial
 
Vista:

URGENTEEEE: Claves de registro

Publicado por matt (1 intervención) el 06/10/2000 00:00:00
Hola, espero que puedan ayudarme.
Necesito enumerar las claves del registro de windows en un combo.,
Por ejemplo, quiero sacar todas las claves dentgro de:

HKEY_LOCAL_MACHINE\Software\Pepito.

Pues quiero sacar todas las claves que cuelgan de Pepito.

¿Alguien sabe como hacerlo?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:URGENTEEEE: Claves de registro

Publicado por tecniCam (220 intervenciones) el 06/10/2000 00:00:00
Prueba con esto, no sé si lo conseguirás, pero...

Const HKEY_CLASSES_ROOT = 1
#Const Win32 = 1
#If Win16 Then
Declare Function RegOpenKey Lib "Shell" _
(ByVal HKeyIn As Long, ByVal LPCSTR As String, HKeyOut As Long) As Long
Declare Function RegCloseKey Lib "Shell" _
(ByVal HKeyIn As Long) As Long
Declare Function RegEnumKey Lib "Shell" _
(ByVal HKeyIn As Long, ByVal SubKeyIn As Long, _
ByVal KeyName As String, ByVal KeyNameLen As Long) As Long
Declare Function RegQueryValue Lib "Shell" _
(ByVal HKeyIn As Long, ByVal SubKey As String, _
ByVal KeyValue As String, KeyValueLen As Long) As Long
#ElseIf Win32 Then
Declare Function RegOpenKey Lib "Shell32" _
(ByVal HKeyIn As Long, ByVal LPCSTR As String, HKeyOut As Long) As Long
Declare Function RegCloseKey Lib "Shell32" _
(ByVal HKeyIn As Long) As Long
Declare Function RegEnumKey Lib "Shell32" _
(ByVal HKeyIn As Long, ByVal SubKeyIn As Long, _
ByVal KeyName As String, ByVal KeyNameLen As Long) As Long
Declare Function RegQueryValue Lib "Shell32" _
(ByVal HKeyIn As Long, ByVal SubKey As String, _
ByVal KeyValue As String, KeyValueLen As Long) As Long
#End If

Function GetRegisteredList() As Variant
Dim hkroot As Long, x As Long, lLen As Long
ReDim strInstalled(99) As String
Dim strKeyID As String * 80, strKeyDesc As String * 80, iKeyCount As Integer
x = RegOpenKey(HKEY_CLASSES_ROOT, "", hkroot)
lLen = 80
Do
strKeyID = S
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE: y II URGENTEEEE: Claves de registro

Publicado por tecniCam (220 intervenciones) el 06/10/2000 00:00:00
Do
strKeyID = String(lLen, 0)
If RegEnumKey(hkroot, iKeyCount, strKeyID, lLen) = 0 Then
lLen = 80
If Mid(strKeyID, 1, 1) <> "." Then
strKeyDesc = String(lLen, 0)
x = RegQueryValue(hkroot, strKeyID, strKeyDesc, lLen)
strInstalled(iKeyCount) = strKeyDesc
lLen = 80
End If
iKeyCount = iKeyCount + 1
If iKeyCount > UBound(strInstalled) Then
´ Add elements if the array gets full.
ReDim Preserve strInstalled(UBound(strInstalled) + 100)
End If
Else
Exit Do
End If
Loop
´ Trim off excess array elements.
ReDim Preserve strInstalled(iKeyCount)
x = RegCloseKey(hkroot)
End Function
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar