no he dicho que sea falso. pero si digo que no se puede generalizar, pues cada lenguaje tiene sus cosas. y como puse en el ejemplo en delphi por ejemplo te puedes volver loco buscando el 00 para ponerlo a 01.
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ú
Function crear() As Long
'si existe devuleve 1 de lo contrario 0
RegOpenKey HKEY_LOCAL_MACHINE, prueba, h
If h Then
crear = 1
Else
RegCreateKey HKEY_LOCAL_MACHINE, prueba, h
crear = 0
End If
End Function
Function valorS(nombre As String, valor As String) As Long
valorS = RegSetValueEx(h, nombre, 0, REG_SZ, ByVal valor, Len(valor))
End Function
Function leerS(nombre As String) As Long
buffer = String(256, 0)
leerS = RegQueryValueEx(h, nombre, 0, REG_SZ, ByVal buffer, Len(buffer))
End Function
Function borrarV(nombre As String) As Integer
borrarV = RegDeleteValue(h, nombre)
End Function
Function borrarC(nombre As String) As Long
RegOpenKey HKEY_LOCAL_MACHINE, "SOFTWARE", h
borrarC = RegDeleteKey(h, nombre)
End Function
Public Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Public 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 ' Note that if you declare the lpData parameter as String, you must pass it By Value.
Public 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 ' Note that if you declare the lpData parameter as String, you must pass it By Value.
Public Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As Long
Public Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long
Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Public Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const prueba = "SOFTWARE\Pruebas"
Public Const REG_SZ = 1