RE:TIPO DE PROGRAMA es posible?
Hola, tuve que trabajar varios minutos para hacerlo, espero te ayude.
Private Const HKEY_CLASSES_ROOT As Long = &H80000000
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
Private Function ConsultaRegistro(ByVal Valor As String) As String
Dim nResultado As Long 'guarda el resultado de las llamadas api
Dim nRegistro As Long 'guarda el handled del registro
Dim nTipoDato As Long 'guarda el tipo de dato del valor
Dim nTamañoDato As Long 'guarda el tamaño del valor
Dim sDato As String 'guarda el valor
'abre el registro
nResultado = RegOpenKey(HKEY_CLASSES_ROOT, Valor, nRegistro)
'si no se pudo abrir se salde de la funcion
If nResultado <> 0 Then
Exit Function
End If
'consulta el tamaño del buffer
nResultado = RegQueryValueEx(nRegistro, vbNullString, 0, nTipoDato, ByVal 0, nTamañoDato)
'si se pudo consultar se obtiene el valor
If nResultado = 0 Then
'crea el buffer
sDato = String(nTamañoDato, " ")
'obtiene el valor
nResultado = RegQueryValueEx(nRegistro, vbNullString, 0, 0, ByVal sDato, nTamañoDato)
If nResultado = 0 Then
'devuelve el resultado
ConsultaRegistro = Left$(sDato, nTamañoDato - 1)
End If
End If
'cierra el registro
RegCloseKey nRegistro
End Function
Private Sub Command1_Click()
Dim sResultado As String
'consulta la extencion
sResultado = ConsultaRegistro(".doc")
'consulta la descripcion
MsgBox ConsultaRegistro(sResultado)
End Sub