gente tengo un problema ...creo q es por q el valor es del tipo dword... :huh:
RegOpenKey HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\...", h
RegSetValueEx h, "Value", 0, REG_DWORD,Byval "00000001", 4
RegCloseKey h
esto me sale en el registro
NOMBRE TIPOS DATOS
--------------------------------------------
Value REG_DWORD 0x30303030(808464432)
quiero q en el registro me salga asi
NOMBRE TIPOS DATOS
---------------------------------------------
Value REG_DWORD 0x00000001(1)
grcias por todo de antemano
Cita de: Anteros en 16 Noviembre 2006, 02:37 AM
gente tengo un problema ...creo q es por q el valor es del tipo dword... :huh:
RegOpenKey HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\...", h
RegSetValueEx h, "Value", 0, REG_DWORD,Byval "00000001", 4
RegCloseKey h
esto me sale en el registro
NOMBRE TIPOS DATOS
--------------------------------------------
Value REG_DWORD 0x30303030(808464432)
quiero q en el registro me salga asi
NOMBRE TIPOS DATOS
---------------------------------------------
Value REG_DWORD 0x00000001(1)
grcias por todo de antemano
Me parece que en el VALOR que pones en Hexadecimal Byval "00000001", quitalo y pon 1
Saludos dime haber....
Cita de: Anteros en 17 Noviembre 2006, 02:08 AM
es igual ya lo probe...sigue el problema :(
Private Const REG_DWORD = 4
Private Const ERROR_SUCCESS = 0&
Private Const HKEY_CURRENT_USER = &H80000001
Private Const STANDARD_RIGHTS_ALL = &H1F0000
Private Const SYNCHRONIZE = &H100000
Private Const KEY_QUERY_VALUE = &H1
Private Const KEY_SET_VALUE = &H2
Private Const KEY_CREATE_LINK = &H20
Private Const KEY_ENUMERATE_SUB_KEYS = &H8
Private Const KEY_CREATE_SUB_KEY = &H4
Private Const KEY_NOTIFY = &H10
Private Const KEY_ALL_ACCESS = ((STANDARD_RIGHTS_ALL Or KEY_QUERY_VALUE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY Or KEY_CREATE_LINK) And (Not SYNCHRONIZE))
Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Private Declare Function RegLoadKey Lib "advapi32.dll" Alias "RegLoadKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal lpFile As String) As Long
Dim resultado As Long
Dim hKey As Long
Private Sub Command1_Click()
resultado = RegOpenKeyEx(HKEY_CURRENT_USER, "Software\SimonTatham\PuTTY\Sessions\Default%20Settings", 0, KEY_ALL_ACCESS, hKey)
If resultado = ERROR_SUCCESS Then
RegSetValueEx hKey, "ProxyPort", 0, REG_DWORD, 3128, 4 'Donde dice 3128 es el DWORD
End If
End Sub
'Bueno nada mas redireccionalo a donde quieras que se agregue y ya....pon el numero en decimal y se acabo...
Saludos..