TIP: Click on subject to list as thread! ANSI
echo: delphi
to: DEWAYNE COX
from: FRANCOIS PIETTE
date: 1996-08-04 09:44:00
subject: Menus..

Salut Dewayne Cox !
  DC> I would also like to know the best way to save user
  DC> configuration of colors for like background and input areas, etc. Is
  DC> there a way to simply write the newly configured objects to a file and
  DC> then readin the saved file?
You can use INI files (Delphi 1 or Delphi 2) using the TIniFile 
object. With Delphi 32 the preferred method is to use the registry 
using the TRegistry object.
Here is an extract from one of my program called MODEMEDT wich 
extensively use the registry to access modem parameters:
function TRegModem.GetKey(const SubKey, Key : String) : String;
var
    KeyBuf : String;
begin
    Reg.RootKey := HKEY_LOCAL_MACHINE;
    KeyBuf := '\System\CurrentControlSet\Services\Class\Modem\' + FNumber;
    if Length(SubKey) > 0 then
        KeyBuf := KeyBuf + '\' + SubKey;
    if not Reg.OpenKey(KeyBuf, FALSE) then
        raise ERegModemException.Create(
               'Key ''HKEY_LOCAL_MACHINE' + KeyBuf + 
               ''' not found in registry');
    Result := Reg.ReadString(Key);
    Reg.CloseKey;
end;
Amiti‚s,
{-Francois Piette-}
--- SvFido 1.32
---------------
* Origin: OverByte BBS (Embourg-Belgium) 32-41-651395 V-FAST (2:293/2202)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.