RE:escribir en el registro de windows
Hola
Para escribir y crear una nueva key en el registro debes declarar primero lo siguiente en General
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" _
(ByVal hKey As Long, ByVal lpSubKey As String, 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
Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const regKey = "Software\Nombre de Compañia\Producto"
Const REG_SZ = 1
despues puedes llamar a estas funciones para crear y escribir la key, como ves key ira dentro de HKEY_LOCAL_MACHINE y \ Software\Nombre de Compañia\Producto
En un evento lo siguiente:
Dim keyValue As String
Dim retValue As Long
Dim keyID As Long
retValue = RegCreateKey(HKEY_LOCAL_MACHINE, regKey, keyID)
keyValue = "Nuestro Software"
retValue = RegSetValueEx(keyID, "Nombre", REG_SZ, 0&, ByVal keyValue, Len(keyValue) + 1)
keyValue = "1.00.1"
retValue = RegSetValueEx(keyID, "Version", 0&, _
REG_SZ, ByVal keyValue, Len(keyValue) + 1)
MsgBox "Registry updated"
Cambia tus valores
Saludos
Victor Collado