unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IniFiles, ShellAPI, ExtCtrls;
type
TForm1 =
class(TForm)
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
CheckBox4: TCheckBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Button1: TButton;
Button2: TButton;
RadioGroup1: TRadioGroup;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
ini: TIniFile;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if (CheckBox1.Checked = True)
then
begin
shellexecute(form1.Handle, '
open', PChar('
pics.bat'),
nil,
nil, sw_show);
end;
if (CheckBox2.Checked = True)
then
begin
shellexecute(form1.Handle, '
open', PChar('
vids.bat'),
nil,
nil, sw_show);
end;
if (CheckBox3.Checked = True)
then
begin
shellexecute(form1.Handle, '
open', PChar('
docs.bat'),
nil,
nil, sw_show);
end;
if (CheckBox4.Checked = True)
then
begin
shellexecute(form1.Handle, '
open', PChar('
arch.bat'),
nil,
nil, sw_show);
end;
Form1.Close;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ini := TIniFile.create(IncludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0))) + '
settings.ini');
try
ini.WriteBool('
myOne','
c1',Checkbox1.Checked);
ini.WriteBool('
myOne','
c2',Checkbox2.Checked);
ini.WriteBool('
myOne','
c3',Checkbox3.Checked);
ini.WriteBool('
myOne','
c4',Checkbox4.Checked);
finally
ini.free;
end;
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
ini := TIniFile.create(IncludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0))) + '
settings.ini');
with ini
do
try
CheckBox1.Checked := ReadBool('
myOne', '
c1', False);
CheckBox2.Checked := ReadBool('
myOne', '
c2', False);
CheckBox3.Checked := ReadBool('
myOne', '
c3', False);
CheckBox4.Checked := ReadBool('
myOne', '
c4', False);
finally
ini.free;
end;
end;
end.