Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - noele1995

#131
Muchas gracias me has aclarado mucho, muy bien explicado tambien. Mañana mismo corregire el codigo.
Gracias de nuevo burbu_1  ;D
#132
Ok eso responde a mi pregunta del color del codigo (no lo corrijo ahora porque con el movil tardo mucho ;D ), pero volviendo al tema de mi pregunta podriais ayudarme con los valores DWORD?
#133
Creo que no es buena idea revivir posts antiguos del Febrero 2009 jejeje
#134
Hola en el proyecto actual que estoy haciendo estoy con el registro de windows, tengo algun que otro problemilla al leer los valores, cuando los valores son DWORD, no consigo leer su valor, les pongo el codigo:

Código (vb) [Seleccionar]
Public Function ValueData(Key As Long, strValueName As String, sType As Long) As String
Dim lResult As Long, RetornoData As Long, strData As String, lngData As Currency, binData() As Byte, sTmp As String
Dim i As Integer
Select Case sType
    Case REG_NONE
        ValueData = vbNullString
   
    Case REG_SZ, REG_EXPAND_SZ, REG_LINK
        lResult = RegQueryValueEx(Key, strValueName, 0, ByVal 0, ByVal 0, RetornoData)
       
        If lResult = 0 Then
            strData = String(RetornoData, Chr$(0))
            lResult = RegQueryValueEx(Key, strValueName, 0, ByVal 0, ByVal strData, RetornoData)
           
            If lResult = 0 Then
                ValueData = Left$(strData, InStr(1, strData, Chr$(0)) - 1)
            End If
        End If
   
    Case REG_MULTI_SZ
        lResult = RegQueryValueEx(Key, strValueName, 0, ByVal 0, ByVal 0, RetornoData)
       
        If lResult = 0 Then
            strData = String(RetornoData, Chr$(0))
            lResult = RegQueryValueEx(Key, strValueName, 0, ByVal 0, ByVal strData, RetornoData)
           
            If lResult = 0 Then
                For i = Len(strData) To 1 Step -1
                    If Mid$(strData, i, 1) = Chr$(0) Then
                    strData = Left$(strData, i - 1)
                    Exit For
                End If
                Next
                For i = 1 To Len(strData)
                    If Mid$(strData, i, 1) = Chr$(0) Then
                    Mid$(strData, i, 1) = " "
                    End If
                Next
               
                ValueData = Left$(strData, InStr(1, strData, Chr$(0)) - 1)
            End If
        End If
        For i = Len(strData) To 1 Step -1
            If Mid$(strData, i, 1) = Chr$(0) Then
                strData = Left$(strData, i - 1)
                Exit For
            End If
        Next
        For i = 1 To Len(strData)
            If Mid$(strData, i, 1) = Chr$(0) Then
                Mid$(strData, i, 1) = " "
            End If
        Next
   
    Case REG_BINARY
        lResult = RegQueryValueEx(Key, strValueName, 0, ByVal 0, ByVal 0, RetornoData)
        If lResult = 0 Then
            ReDim binData(RetornoData)
            lResult = RegQueryValueEx(Key, strValueName, 0, ByVal 0, binData(0), RetornoData)
           
            If lResult = 0 Then
                For i = 0 To UBound(binData) - 1
                    sTmp = sTmp & Right$("00" & Hex$(binData(i)), 2) & " "
                Next
                ValueData = sTmp
            End If
        End If
       
    Case REG_DWORD, REG_DWORD_BIG_ENDIAN
        lResult = RegQueryValueEx(Key, strValueName, 0, ByVal 0, lngData, RetornoData)
        If lResult = 0 Then
            ValueData = "0x" & Right$("00000000" & Hex$(lngData), 8) & " (" & lngData & ")"
        End If
    Case Else
        lResult = RegQueryValueEx(Key, strValueName, 0, ByVal 0, ByVal 0, RetornoData)
        If lResult = 0 Then
            strData = String(RetornoData, Chr$(0))
            lResult = RegQueryValueEx(Key, strValueName, 0, ByVal 0, ByVal strData, RetornoData)
           
            If lResult = 0 Then
                ValueData = Left$(strData, InStr(1, strData, Chr$(0)) - 1)
            End If
        End If
End Select
End Function


A la funcion se la llama con la clave ya abierta, si pueden ayudarme se lo agradeceria.

PD: ¿Como hacen para que el codigo salga con colores? Es menos lioso xD
#135
 Ahora mismo lo pruebo, muchas gracias Karcrack ;D!!
#136
Me preguntaba si alguien podria ayudarme con el codigo para detectar si hay una webcam disponible en la pc. He probado con varias cosas pero me han terminado de ir bien y googleando tampoco he encontrado cosas que funcionen correctamente.

Gracias de antemano