Показать сообщение отдельно

  #3  
Старый 20.04.2009, 12:39
s0l_ir0n
Участник форума
Регистрация: 14.03.2009
Сообщений: 237
Провел на форуме:
813785

Репутация: 314
Отправить сообщение для s0l_ir0n с помощью ICQ
Cool

У меня сегодня не плохое настроение
Кусок кодес из проги 2к6 года
Код:
uses
registry;

procedure loadregsettings;
var
  h: TRegistry;
begin
  h := TRegistry.Create;
  with h do
  begin
    RootKey := HKEY_CURRENT_USER;
    If h.KeyExists('\Software\mysoft')
    then OpenKey('\Software\mysoft', true)
    Else begin h.CreateKey('\Software\mysoft');
               OpenKey('\Software\mysoft', true)
               end;

    if h.ValueExists('Make backup')
    then begin
    If h.ReadBool('Make backup')=true
    Then Form1.CheckBox8.Checked:=true
    Else Form1.CheckBox8.Checked:=false;
    end
    Else
    h.WriteBool('Make backup',True);

    if h.ValueExists('Compatibility')
    then begin
    If h.ReadBool('Compatibility')=true
    Then Form1.CheckBox1.Checked:=true
    Else Form1.CheckBox1.Checked:=false;
    end
    Else
    h.WriteBool('Compatibility',True);
    CloseKey;
    Free;
    end;
    end;

procedure saveregsettings;
var
  h: TRegistry;
begin
  h := TRegistry.Create;
  with h do
  begin
    RootKey := HKEY_CURRENT_USER;
    If h.KeyExists('\Software\mysoft')
    then OpenKey('\Software\mysoft', true)
    Else begin h.CreateKey('\Software\mysoft');
               OpenKey('\Software\mysoft', true)
               end;

    if h.ValueExists('Compatibility')
    then h.WriteBool('Compatibility',Form1.CheckBox1.Checked)
    Else h.WriteBool('Compatibility',True);

    if h.ValueExists('Make backup')
    then h.WriteBool('Make backup',Form1.CheckBox8.Checked)
    Else h.WriteBool('Make backup',True);
    CloseKey;
    Free;
    end;
    end;
 
Ответить с цитированием