unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, inifiles, ShellAPI, ComCtrls, StdCtrls, Menus;
type
TForm1 =
class(TForm)
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
ProgressBar1: TProgressBar;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Edit8: TEdit;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
CheckBox4: TCheckBox;
CheckBox5: TCheckBox;
CheckBox6: TCheckBox;
CheckBox7: TCheckBox;
MainMenu1: TMainMenu;
Sichern1: TMenuItem;
Allessichern1: TMenuItem;
AusgewhlteDatensichern1: TMenuItem;
Optionen1: TMenuItem;
ber1: TMenuItem;
Exit1: TMenuItem;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Edit9: TEdit;
Edit10: TEdit;
Edit11: TEdit;
Aktualisieren1: TMenuItem;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
CheckBox8: TCheckBox;
CheckBox9: TCheckBox;
CheckBox10: TCheckBox;
Label15: TLabel;
procedure Exit1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure AusgewhlteDatensichern1Click(Sender: TObject);
procedure Optionen1Click(Sender: TObject);
procedure Aktualisieren1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Allessichern1Click(Sender: TObject);
private
{ Private-Deklarationen }
function SHCopyFile(
Handle: THandle; szSource, szDestination: TFileName): Boolean;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
function TForm1.SHCopyFile(
Handle: THandle; szSource, szDestination: TFileName): Boolean;
var
ShellFileOperation: TSHFileOpStruct;
begin
Result := True;
try
with ShellFileOperation
do
begin
Wnd :=
Handle;
wFunc := FO_COPY;
pFrom := PChar(szSource);
pTo := PChar(szDestination);
// fFlags := FOF_FILESONLY OR FOF_NOCONFIRMMKDIR FOF_SIMPLEPROGRESS;
fFlags := FOF_NOCONFIRMMKDIR;
lpszProgressTitle := '
Dateien kopieren ...';
end;
SHFileOperation(ShellFileOperation);
except
Result := False;
end;
end;
procedure TForm1.Exit1Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.FormCreate(Sender: TObject);
var ini:TInifile;
begin
ini := TIniFile.Create('
C:\Programme\SCC\Settings.ini');
try
Edit2.Text:=ini.ReadString('
Source','
1','
Text');
Edit3.Text:=ini.ReadString('
Source','
2','
Text');
Edit4.Text:=ini.ReadString('
Source','
3','
Text');
Edit5.Text:=ini.ReadString('
Source','
4','
Text');
Edit6.Text:=ini.ReadString('
Source','
5','
Text');
Edit7.Text:=ini.ReadString('
Source','
6','
Text');
Edit8.Text:=ini.ReadString('
Source','
7','
Text');
Edit9.Text:=ini.ReadString('
Source','
8','
Text');
Edit10.Text:=ini.ReadString('
Source','
9','
Text');
Edit11.Text:=ini.ReadString('
Source','
10','
Text');
Label3.Caption:=ini.ReadString('
AppName','
1','
Caption');
Label4.Caption:=ini.ReadString('
AppName','
2','
Caption');
Label5.Caption:=ini.ReadString('
AppName','
3','
Caption');
Label6.Caption:=ini.ReadString('
AppName','
4','
Caption');
Label7.Caption:=ini.ReadString('
AppName','
5','
Caption');
Label8.Caption:=ini.ReadString('
AppName','
6','
Caption');
Label9.Caption:=ini.ReadString('
AppName','
7','
Caption');
Label10.Caption:=ini.ReadString('
AppName','
8','
Caption');
Label11.Caption:=ini.ReadString('
AppName','
9','
Caption');
Label12.Caption:=ini.ReadString('
AppName','
10','
Caption');
finally
ini.Free;
end;
end;
procedure TForm1.AusgewhlteDatensichern1Click(Sender: TObject);
var filesource, filedest:
string;
var ini:TInifile;
begin
ini:=TInifile.Create('
C:\Programe\SCC\Settings.ini');
try
IF CheckBox1.Checked
THEN fileSource:=ini.ReadString('
source','
1',Text);
filedest:=ini.ReadString('
Destination','
1',Text);
CopyFile(PChar(fileSource), PChar(fileDest), False);
finally
ini.Free;
end;
end;
procedure TForm1.Optionen1Click(Sender: TObject);
begin
Form1.Visible:=False;
Form2.Visible:=True;
end;
procedure TForm1.Aktualisieren1Click(Sender: TObject);
var ini:TInifile;
begin
ini := TIniFile.Create('
C:\Programme\SCC\Settings.ini');
try
Edit2.Text:=ini.ReadString('
Source','
1','
Text');
Edit3.Text:=ini.ReadString('
Source','
2','
Text');
Edit4.Text:=ini.ReadString('
Source','
3','
Text');
Edit5.Text:=ini.ReadString('
Source','
4','
Text');
Edit6.Text:=ini.ReadString('
Source','
5','
Text');
Edit7.Text:=ini.ReadString('
Source','
6','
Text');
Edit8.Text:=ini.ReadString('
Source','
7','
Text');
Edit9.Text:=ini.ReadString('
Source','
8','
Text');
Edit10.Text:=ini.ReadString('
Source','
9','
Text');
Edit11.Text:=ini.ReadString('
Source','
10','
Text');
Label3.Caption:=ini.ReadString('
AppName','
1','
Caption');
Label4.Caption:=ini.ReadString('
AppName','
2','
Caption');
Label5.Caption:=ini.ReadString('
AppName','
3','
Caption');
Label6.Caption:=ini.ReadString('
AppName','
4','
Caption');
Label7.Caption:=ini.ReadString('
AppName','
5','
Caption');
Label8.Caption:=ini.ReadString('
AppName','
6','
Caption');
Label9.Caption:=ini.ReadString('
AppName','
7','
Caption');
Label10.Caption:=ini.ReadString('
AppName','
8','
Caption');
Label11.Caption:=ini.ReadString('
AppName','
9','
Caption');
Label12.Caption:=ini.ReadString('
AppName','
10','
Caption');
finally
ini.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Progressbar1.StepIt;
end;
procedure TForm1.Allessichern1Click(Sender: TObject);
var ini:TInifile;
begin
ini := TIniFile.Create('
C:\Programme\SCC\Settings.ini');
try
ini.ReadString
finally
ini.free;
end;
end;
end.