How to save DWord values in registry

aewarnick

Well-known member
Joined
Jan 29, 2003
Messages
1,031
All I can save so far is regular values in the registry using SetValue. How can I save DWord values?
 
Nevermind. You just save it as a number. All I need is how to get the integer equivalenes of these color values:

fff9fbdd
ffe7e8d0
ffbfe0f2
ffe7e8d0
ffd5e2ec
 
Last edited by a moderator:
Nevermind, the integer equivalent is too big.
And even when I put it in my code like this:

CommunicationLog.RegColors.SetValue("LogBoxColor", 0xffeeecd7);

It still saves as a string and not a dword. I am stumped.
 
These are both red

CommunicationLog.RegColors.SetValue("LogBoxColor", 0xffff0000);
//TBLabelsColor
CommunicationLog.RegColors.SetValue("TBLabelsColor", -65536);

but the top is the one seen in the registry and it does not work in the code. I dont see any way to get that bottom number for unknown colors (unlike red).

I dont see how those 2 numbers are alike because in the registry it says that 0xffff0000 is 4294901760 and not -65536.

Can someone help?

By the way, I am using the FromArgb methods to get the colors.
 
Here is how I ended up doing it:

SetValue("LogBoxColor", ColorTranslator.FromHtml("#fff8f9d9").ToArgb());
 
Back
Top