Click here to Skip to main content
15,884,473 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
Hi,
I have been trying to set the value of the following key: HKLM\System\GWE, "SysColor".
The code I have is this:
C#
byte[] data = new byte[] {
    0xC9, 0xD2, 0xE9, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x37, 0x4B, 0xD3, 0x00, 0x8D, 0x96, 0xD5, 0x00, 
    0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 
    0x00, 0x00, 0x00, 0x00, 0x12, 0x0C, 0x7F, 0x00, 
    0x09, 0x07, 0x33, 0x00, 0xCB, 0xC9, 0xE9, 0x00, 
    0x00, 0x00, 0x99, 0x00, 0xC0, 0xC0, 0xC0, 0x00, 
    0xFF, 0xFF, 0xFF, 0x00, 0x2D, 0x5E, 0xCF, 0x00, 
    0xFF, 0xFF, 0xFF, 0x00, 0xC9, 0xCD, 0xE9, 0x00, 
    0x7F, 0x7F, 0x7F, 0x00, 0x99, 0x99, 0x99, 0x00, 
    0x09, 0x07, 0x33, 0x00, 0xCB, 0xC9, 0xE9, 0x00, 
    0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0xFF, 0xFF, 0xCC, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 
    0x09, 0x07, 0x33, 0x00, 0x4F, 0x9A, 0xF6, 0x00, 
    0xC0, 0xC0, 0xC0, 0x00 };

Microsoft.Win32.Registry.SetValue("HKEY_LOCAL_MACHINE\\System\\GWE",
 "SysColor", data, Microsoft.Win32.RegistryValueKind.Binary);

and:
C#
RegistryKey def2 = Registry.LocalMachine.OpenSubKey("\\SYSTEM\\GWE", true);
def2.SetValue("SysColor", "
C9,D2,E9,00,00,00,00,00,37,4B,D3,00,8D,96,D5,00,
FF,FF,FF,00,FF,FF,FF,00,00,00,00,00,12,0C,7F,00,
09,07,33,00,CB,C9,E9,00,00,00,99,00,C0,C0,C0,00,
FF,FF,FF,00,2D,5E,CF,00,FF,FF,FF,00,C9,CD,E9,00,
7F,7F,7F,00,99,99,99,00,09,07,33,00,CB,C9,E9,00,
FF,FF,FF,00,00,00,00,00,FF,FF,FF,00,00,00,00,00,
FF,FF,CC,00,FF,FF,FF,00,09,07,33,00,4F,9A,F6,00,
C0,C0,C0,00");

The value gets changed, but not all data is set into the value.
Here is what happens:
C9D2E90000000000374BD3008D96D500
DEDEDE00DEDEDE0000000000120C7F00
09073300CBC9E90000009900C0C0C000
FFFFFF003762D300CBC9E900C9CDE900
7F7F7F009999990009073300CBC9E900
FFFFFF0000000000FFFFFF0000000000
FFFFCC00DEDEDE00090733004F9AF600
C0C0C000

It seems that after the bold values, all the other values are ignored.
Can anyone please help me?
Thanks
Nuno

Although the first values are updated after
--------------------------------------------------------------------------------
Best Regards:
Nuno Luz
Posted
Updated 10-Feb-10 5:01am
v4

1 solution

Your question is not clear, I cannot see any lines that are bold, and all the snippets you show suggest that all the data has been set in the key. Can you clarify please?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900