Changing Registry Binary Value 
Author Message
 Changing Registry Binary Value

Please help me if you can, this is urgent.

 I want to change a binary value somewhere in the registry. The value
reads (00 95 00 00), I
 have to make it (00 00 00 00). First of all, I do not understand the
format of these binary
 values. For that reason, I cannot modify it. I use the "RegSetValueEx"
function to change
 its value and set it to a simple 0, and the value in the registry
becomes "zero-length binary
 value".

 Please help me with this. I suppose I do not know what that binary type
means, therefore
 I cannot change it the correct way.

 I would be glad if you could reply to my mail adress.

 Thanks in advance...



Tue, 27 Oct 1998 03:00:00 GMT  
 Changing Registry Binary Value

Quote:

>Please help me if you can, this is urgent.
> I want to change a binary value somewhere in the registry. The value
>reads (00 95 00 00), I
> have to make it (00 00 00 00). First of all, I do not understand the
>format of these binary
> values. For that reason, I cannot modify it. I use the "RegSetValueEx"
>function to change
> its value and set it to a simple 0, and the value in the registry
>becomes "zero-length binary
> value".
> Please help me with this. I suppose I do not know what that binary type
>means, therefore
> I cannot change it the correct way.
> I would be glad if you could reply to my mail adress.

Public Const REG_BINARY = (3)                       'Free form binary

Declare Function RegSetValueEx Lib "advapi32" Alias "RegSetValueExA" _
  (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As
Long, _
   ByVal dwType As Long, ByVal szData As String, ByVal cbData As Long)
As Long

I'm guessing that your trouble is with the last two parameters in the
function. A binary type can be anything, it is just a bunch of bytes
with a length attached. Try creating a string and a length:
(using the parameter names in the declaration above)

szData = Chr$(0) & Chr$(0) & Chr$(0) & Chr$(0)
cbData = 4      ' Len(szData)

and call the function with these parameters.

result = RegSetValueEx( hKey, lpValueName, 0, REG_BINARY, szData,
cbData )

Cheers,
        lauren :}



Wed, 28 Oct 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Reading binary registry values (REG_BINARY)

2. Writing Binary Values to the Registry

3. BINARY values in the registry?

4. Wrinting binary values to the registry

5. Registry binary values

6. binary REGISTRY KEY VALUES

7. Retrieveing a BINARY value from the Registry

8. WRITING BINARY REGISTRY VALUE

9. Editing Binary values in the registry

10. Reading binary values from the registry?

11. Editing binary values in the registry

12. How to write binary value to registry with RegWrite

 

 
Powered by phpBB® Forum Software