вот модуль для регистра
Public Function UpdateKey(KeyRoot As Long, KeyName As String, SubKeyName As String, SubKeyValue As Variant, KeyType As Integer) As Boolean
On Error Resume Next
Dim rc As Long ' Return Code
Dim hKey As Long ' Handle To A Registry Key
Dim hDepth As Long '
Dim lpAttr As SECURITY_ATTRIBUTES ' Registry Security Type
Dim ab() As Byte
ab = SubKeyValue
lpAttr.nLength = 50 ' Set Security Attributes To Defaults...
lpAttr.lpSecurityDescriptor = 0 ' ...
lpAttr.bInheritHandle = True ' ...
'------------------------------------------------------------
'- Create/Open Registry Key...
'------------------------------------------------------------
rc = RegCreateKeyEx(KeyRoot, KeyName, _
0, KeyType, _
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, lpAttr, _
hKey, hDepth) ' Create/Open //KeyRoot//KeyName
If (rc <> ERROR_SUCCESS) Then GoTo CreateKeyError ' Handle Errors...
'------------------------------------------------------------
'- Create/Modify Key Value...
'------------------------------------------------------------
If (SubKeyValue = "") Then SubKeyValue = " " ' A Space Is Needed For RegSetValueEx() To Work...
' Create/Modify Key Value
'RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal lpData As String, ByVal cbData As Long) As Long
If KeyType = 4 Then
rc = RegSetValueEx(hKey, SubKeyName, 0, 4, CByte(SubKeyValue), 4)
Else
rc = RegSetValueEx(hKey, SubKeyName, 0, KeyType, SubKeyValue, Len(SubKeyValue))
End If
If (rc <> ERROR_SUCCESS) Then GoTo CreateKeyError ' Handle Error
'------------------------------------------------------------
'- Close Registry Key...
'------------------------------------------------------------
rc = RegCloseKey(hKey) ' Close Key
UpdateKey = True ' Return Success
Exit Function ' Exit
CreateKeyError:
UpdateKey = False ' Set Error Return Code
rc = RegCloseKey(hKey) ' Attempt To Close Key
End Function
я хочу видеть нулль дворд как регедит делает "subkey"=dword:00000000
я делаю UpdateKey HKEY_LOCAL_MACHINE, "SYSTEM", "subkey", 0, 4
а на самом деле получается дворд но в 16ричной = 30 и в десятичной = 48
как мне добиться нуля в дворде с этим модулем?