unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    CheckBox1: TCheckBox;
    procedure CheckBox1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses Rejestr;

{$R *.dfm}

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
if CheckBox1.Checked then
    ZapiszAutostart('Helion',Application.ExeName)
    else
    UsunAutostart('Helion');
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
ZapiszUstawieniaOkna(Self,'\Software\Helion\Przyklad\Okno',True);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
CzytajUstawieniaOkna(Self,'\Software\Helion\Przyklad\Okno',False);
CheckBox1.Checked:=SprawdzAutostart('Helion');
end;

end.
