Board index » delphi » Storing Colors in the registry

Storing Colors in the registry


2004-04-18 10:41:04 AM
delphi132
Hi
Anyone know how to store a color ( hexadecimal) in the registry for future
retrival.
Thanks
Brian Murphy
 
 

Re:Storing Colors in the registry

Hi,
The easiest way i can think up is making a TRegistry component and using the
WriteInteger method
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_CURRENT_USER;
if Reg.OpenKey('\Software\MyProgs\ProgName', True) then begin
Reg.WriteInteger('PanelColour', Integer(ColourVarName));
Reg.CloseKey;
end;
finally
Reg.Free;
end;
TColor is compatible with Integer, so it should work
Good luck
"Brian Murphy" <XXXX@XXXXX.COM>schreef in bericht
Quote
Hi
Anyone know how to store a color ( hexadecimal) in the registry for future
retrival.
Thanks
Brian Murphy


 

Re:Storing Colors in the registry

That work great.
Thanks Roel
Brian
"Roel Messiant/Mephy" <XXXX@XXXXX.COM>writes
Quote
Hi,

The easiest way i can think up is making a TRegistry component and using
the
WriteInteger method

Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_CURRENT_USER;
if Reg.OpenKey('\Software\MyProgs\ProgName', True) then begin
Reg.WriteInteger('PanelColour', Integer(ColourVarName));
Reg.CloseKey;
end;
finally
Reg.Free;
end;

TColor is compatible with Integer, so it should work

Good luck

"Brian Murphy" <XXXX@XXXXX.COM>schreef in bericht
news:XXXX@XXXXX.COM...
>Hi
>Anyone know how to store a color ( hexadecimal) in the registry for
future
>retrival.
>Thanks
>Brian Murphy
>
>