Delphi2011.12.26 10:24
//레지스트리 값 읽기
function TFormMain.GetSetting(AKey, AGroup: String): String;
var
  Registry: TRegistry;
begin
  Result := '';
  if AGroup = '' then
    AGroup := 'Settings';
  Registry := TRegistry.Create(KEY_READ);
  try
    Registry.RootKey := HKEY_CURRENT_USER;
    Registry.OpenKey('Software\MyProgram\' + AGroup, True);
    Result := Registry.ReadString(AKey);
    Registry.CloseKey;
  finally
    Registry.Free;
  end;
end;


//레지스트리에 값 쓰기
function TFormMain.SaveSetting(AKey, AValue, AGroup: String): Boolean;
var
  Registry: TRegistry;
begin
  if AGroup = '' then
    AGroup := 'Settings';

  Registry := TRegistry.Create(KEY_WRITE);
  try
    Registry.RootKey := HKEY_CURRENT_USER;
    Registry.OpenKey('Software\MyProgram\' + AGroup, True);
    Registry.WriteString(AKey, AValue);
    Registry.CloseKey;
    Result := True;
  finally
    Registry.Free;
  end;
end;


//레지스트리 값 지우기
function TFormMain.DeleteSetting(Akey, AGroup: String):Boolean;
var
   Registry: TRegistry;
begin
     if AGroup = '' then
    AGroup := 'Settings';

     Registry := TRegistry.Create;
     try
     Registry.RootKey := HKEY_CURRENT_USER;
     Registry.OpenKey('Software\MyProgram\' + AGroup, True);
     Registry.DeleteValue(Akey);
     Registry.CloseKey;
     Result:= True;
     finally
     Registry.Free;
     end;
end;



델파이 하기 싫엉 ㅠㅠ 
Posted by 하품 - yawn 하품 - yawn