unit Unit1;
interface
uses
; Windows, Messages, SysUtils, Classes, Graphics,s_reg, Controls, Forms, Dialogs,
; StdCtrls, Buttons, ComCtrls, ExtCtrls, Unit7;
type
; TForm1 = class(TForm)
; ; Panel1: TPanel;
; ; OpenDialog1: TOpenDialog;
; ; OpenDialog2: TOpenDialog;
; ; Animate1: TAnimate;
; ; Frame71: TFrame7;
; ; procedure SpeedButton1Click(Sender: TObject);
; ; procedure SpeedButton2Click(Sender: TObject);
; ; procedure Button1Click(Sender: TObject);
; ; //procedure Button2Click(Sender: TObject);
; ; procedure FormCreate(Sender: TObject);
; ; //procedure Button3Click(Sender: TObject);
; private
; ; { Private declarations }
; public
; ; { Public declarations }
; end;
; function RestoreFile(SourceFileName, TargetFileName: string ): Longint;
var
; Form1: TForm1;
implementation
uses Unit2, Unit3, Unit4;
{$R *.DFM}
function RestoreFile(SourceFileName, TargetFileName: string ): Longint;
var
; SourceFile, TargetFile: TFileStream;
begin
; SourceFile := nil;
; TargetFile := nil;
; try
; ; SourceFile := TFileStream.Create(SourceFileName, fmOpenRead + fmShareDenyNone);
; ; if SourceFile = nil then
; ; begin
; ; ; //文件打不开
; ; ; Result := -1;
; ; ; Exit;
; ; end;
; ; TargetFile := TFileStream.Create(TargetFileName, fmOpenReadWrite + fmShareExclusive);
; ; if TargetFile = nil then
; ; begin
; ; ; //文件创建失败
; ; ; SourceFile.Free;
; ; ; Result := -2;
; ; ; Exit;
; ; end;
; ; ; SourceFile.Position := 0;
; ; ; TargetFile.Position:=TargetFile.Size;
; ; ; TargetFile.CopyFrom(SourceFile, sourcefile.size);
; ; SourceFile.Free;
; ; TargetFile.Free;
; except
; ; if SourceFile <> nil then SourceFile.Free;
; ; if TargetFile <> nil then TargetFile.Free;
; end;
; result :=1;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
; //if self.OpenDialog1.Execute then edit1.Text :=opendialog1.FileName;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
; //if self.OpenDialog2.Execute then edit2.Text :=opendialog2.FileName;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
; //RestoreFile(edit2.text, edit1.text )
end;
procedure TForm1.FormCreate(Sender: TObject);
var
; filepath:string;
begin
; filepath:=application.ExeName;
; Setregstring(HKEY_CLASSES_ROOT,'*/shell/filecut' ,'','文件分割机');
; Setregstring(HKEY_CLASSES_ROOT,'*/shell/filecut/command' ,'',filepath);
; form2:=Tform2.Create (nil);
; form3:=Tform3.Create (nil);
; form3.ClientHeight:=0;
; form2.Parent :=panel1;
; //form2.Align :=alLeft;
; form2.top:=0;
; form2.Left :=0;
; form2.Height:=panel1.Height-form3.Height;
; form2.Show;
; form3.Parent :=panel1;
; //form2.Align :=alLeft;
;
; //form3.Height:=self.ClientHeight-form2.Height;
; form3.top:=form2.Height;
; form3.Left :=0;
; //form2.ClientHeight:=0;
; form3.Show ;
end;
end.