PHP Kod: Kodu kopyalamak için üzerine çift tıklayın!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, cxGraphics, cxControls, cxLookAndFeels,
cxLookAndFeelPainters, cxContainer, cxEdit, dxSkinsCore, dxSkinBlack,
dxSkinBlue, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide,
dxSkinFoggy, dxSkinGlassOceans, dxSkiniMaginary, dxSkinLilian,
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMoneyTwins,
dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black,
dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinPumpkin, dxSkinSeven,
dxSkinSharp, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
dxSkinsDefaultPainters, dxSkinValentine, dxSkinXmas2008Blue, acPNG, cxImage,
AdvSmartMessageBox, sLabel, sSkinManager;
type
TDropForm = class(TForm)
cxImage1: TcxImage;
mesaj: TAdvSmartMessageBox;
sLabelFX1: TsLabelFX;
sSkinManager1: TsSkinManager;
///Memo1: TMemo;
procedure FormCreate(Sender: TObject) ;
procedure cxImage1DblClick(Sender: TObject);
procedure ayristir (var uzanti:string ; filename:string ; dosyaadi:string;dizinmis:string) ;
private
procedure WMDROPFILES(var msg : TWMDropFiles) ; message WM_DROPFILES;
public
{ Public declarations }
end;
var
DropForm: TDropForm;
implementation
{$R *.dfm}
uses ShellApi, Unit2, Unit3;
//form’s OnCreate event handler
procedure TDropForm.cxImage1DblClick(Sender: TObject);
begin
form2.show;
end;
procedure TDropForm.FormCreate(Sender: TObject) ;
begin
SetWindowPos(dropform.Handle,
HWND_TOPMOST,
0, 0, 0, 0,
SWP_NOMOVE or SWP_NOSIZE or SWP_SHOWWINDOW);
//form is ready to accept files
DragAcceptFiles( Handle, True ) ;
end;
(* handle files being dropped on a form *)
procedure TDropForm.WMDROPFILES(var msg: TWMDropFiles) ;
const
MAXFILENAME = 255;
var
cnt, fileCount : integer;
fileName : array [0..MAXFILENAME] of char;
uzanti:string;
dosyaadi,dizinler,adsizlar:string;
begin
// how many files dropped?
fileCount := DragQueryFile(msg.Drop, $FFFFFFFF, fileName, MAXFILENAME) ;
// query for file names
for cnt := 0 to -1 + fileCount do
begin
DragQueryFile(msg.Drop, cnt, fileName, MAXFILENAME) ;
//do something with the file(s)
/// memo1.Lines.Insert(0, fileName) ;
///
uzanti:= ExtractFileExt(filename);
dosyaadi:=ExtractFileName(filename);
dizinler:=ExtractFileDir(filename);
ayristir(uzanti,filename,dosyaadi,dizinler);
end;
//release memory
DragFinish(msg.Drop) ;
end;
procedure TDropForm.ayristir (var uzanti:string ; filename:string ; dosyaadi:string ;dizinmis:string) ;
var
i,j,k,l,m,n:integer;
adsizlar:string;
tanımlandı:boolean;
buttonSelected,buttonSelected2 : Integer;
begin
adsizlar:=ChangeFileExt(ExtractFileName(FileName), ’’);
tanımlandı:=false;
/// showmessage(uzanti) ;
for i := 0 to form2.-----.Items.Count – 1 do
begin
if lowercase(form2.-----.Items)=lowercase(uzanti) then
begin
if FileExists(form2.viddiz.Text+’\\\\\\\\’+dosyaadi) then
begin
showmessage(’Bu dizinde aynı isimli dosya var.Tarih eklenerek kaydedildi’);
MoveFilew(pchar(filename),pchar(form2.viddiz.Text+’\\\\\\\\’+adsizlar+’-’+datetostr(now)+uzanti)) ;
tanımlandı:=true;
break
end
else
begin
MoveFilew(pchar(filename),pchar(form2.viddiz.Text+’\\\\\\\\’+dosyaadi)) ;
tanımlandı:=true;
mesaj.Messages.Clear;
mesaj.Messages.Add.Text:=(’<B><FONT face=”Arial”>Bu Bir ----- Dosyası Şu anda kopyalanıyor</FONT></B>’);
mesaj.Messages.ShowAll;
end;
end;
end;
for j := 0 to form2.audio.Items.Count – 1 do
begin
if lowercase(form2.audio.Items[j])=lowercase(uzanti) then
begin
if FileExists(form2.sesdiz.Text+’\\\\\\\\’+dosyaadi) then
begin
showmessage(’Bu dizinde aynı isimli dosya var.Tarih eklenerek kaydedildi’);
MoveFilew(pchar(filename),pchar(form2.sesdiz.Text+’\\\\\\\\’+adsizlar+’-’+datetostr(now)+uzanti)) ;
tanımlandı:=true;
break
end
else
begin
MoveFilew(pchar(filename),pchar(form2.sesdiz.Text+’\\\\\\\\’+dosyaadi)) ;
tanımlandı:=true;
mesaj.Messages.Clear;
mesaj.Messages.Add.Text:=(’<B><FONT face=”Arial”>Bu Bir Audio Dosyası Şu anda kopyalanıyor</FONT></B>’);
mesaj.Messages.ShowAll;
end;
end;
end;
for k := 0 to form2.image.Items.Count – 1 do
begin
if lowercase(form2.image.Items[k])=lowercase(uzanti) then
begin
if FileExists(form2.imgdiz.Text+’\\\\\\\\’+dosyaadi) then
begin
showmessage(’Bu dizinde aynı isimli dosya var.Tarih eklenerek kaydedildi’);
MoveFilew(pchar(filename),pchar(form2.imgdiz.Text+’\\\\\\\\’+adsizlar+’-’+datetostr(now)+uzanti)) ; ;
tanımlandı:=true;
break
end
else
begin
MoveFilew(pchar(filename),pchar(form2.imgdiz.Text+’\\\\\\\\’+dosyaadi)) ;
tanımlandı:=true;
mesaj.Messages.Clear;
mesaj.Messages.Add.Text:=(’<B><FONT face=”Arial”>Bu Bir İmaj Dosyası Şu anda kopyalanıyor</FONT></B>’);
mesaj.Messages.ShowAll;
end;
end;
end;
for l := 0 to form2.arch.Items.Count – 1 do
begin
if lowercase(form2.arch.Items[l])=lowercase(uzanti) then
begin
if FileExists(form2.arcdiz.Text+’\\\\\\\\’+dosyaadi) then
begin
showmessage(’Bu dizinde aynı isimli dosya var.Tarih eklenerek kaydedildi’);
MoveFilew(pchar(filename),pchar(form2.arcdiz.Text+’\\\\\\\\’+adsizlar+’-’+datetostr(now)+uzanti)) ;
tanımlandı:=true;
break
end
else
begin
MoveFilew(pchar(filename),pchar(form2.arcdiz.Text+’\\\\\\\\’+dosyaadi)) ;
tanımlandı:=true;
mesaj.Messages.Clear;
mesaj.Messages.Add.Text:=(’<B><FONT face=”Arial”>Bu Bir Arşiv Dosyası Şu anda kopyalanıyor</FONT></B>’);
mesaj.Messages.ShowAll;
end;
end;
end;
for m := 0 to form2.wordex.Items.Count – 1 do
begin
if lowercase(form2.wordex.Items[m])=lowercase(uzanti) then
begin
if FileExists(form2.wordexcel.Text+’\\\\\\\\’+dosyaadi) then
begin
showmessage(’Bu dizinde aynı isimli dosya var.Tarih eklenerek kaydedildi’);
MoveFilew(pchar(filename),pchar(form2.wordexcel.Text+’\\\\\\\\’+adsizlar+’-’+datetostr(now)+uzanti)) ;
tanımlandı:=true;
break
end
else
begin
MoveFilew(pchar(filename),pchar(form2.wordexcel.Text+’\\\\\\\\’+dosyaadi)) ;
tanımlandı:=true;
mesaj.Messages.Clear;
mesaj.Messages.Add.Text:=(’<B><FONT face=”Arial”>Bu Bir Word-Excel Dosyası Şu anda kopyalanıyor</FONT></B>’);
mesaj.Messages.ShowAll;
end;
end;
end;
if tanımlandı=false then
begin
ButtonSelected := MessageDlg(’Dosya Uzantısı Tanımlanamadı.Bu bir dizin midir?’,mtWarning, mbyesno, 0);
// Show the button type selected
if buttonSelected = mryes then
klasor.show;
klasor.dizin.caption:=filename;
if buttonSelected = mrno then
ButtonSelected2 := MessageDlg(’Bu bir Dosya olarak işleme alınacaktır Ivır-Zıvır kısmına atılacaktır?’,mtWarning, mbyesno, 0);
if buttonSelected2 = mryes then
MoveFilew(pchar(filename),pchar(form2.ivirdir.Text+’\\\\\\\\’+dosyaadi)) ;
end;
end;
end.
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, sMemo, sListBox, Mask, sMaskEdit, sCustomComboEdit,
sTooledit, sEdit;
type
TForm2 = class(TForm)
-----: TsListBox;
arch: TsListBox;
audio: TsListBox;
image: TsListBox;
viddiz: TsDirectoryEdit;
sesdiz: TsDirectoryEdit;
imgdiz: TsDirectoryEdit;
arcdiz: TsDirectoryEdit;
Memo1: TMemo;
ivirdir: TsDirectoryEdit;
wordex: TsListBox;
wordexcel: TsDirectoryEdit;
procedure FormDblClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure viddizChange(Sender: TObject);
procedure sesdizChange(Sender: TObject);
procedure imgdizChange(Sender: TObject);
procedure arcdizChange(Sender: TObject);
procedure dizinkaydet;
procedure FormCreate(Sender: TObject);
procedure ivirdirChange(Sender: TObject);
procedure wordexcelChange(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.arcdizChange(Sender: TObject);
begin
memo1.Lines.Strings[3]:=arcdiz.text ;
//memo1.Lines.ValueFromIndex[3]=arcdiz.Text;
dizinkaydet;
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
if FileExists(’C:\\\\\\\\Program Files\\\\\\\\ayristirici\\\\\\\\dirlist.lst’) then
form2.Memo1.Lines.LoadFromFile(’C:\\\\\\\\Program Files\\\\\\\\ayristirici\\\\\\\\dirlist.lst’);
viddiz.text:=memo1.Lines.Strings[0];
sesdiz.text:=memo1.Lines.Strings[1];
imgdiz.text:=memo1.Lines.Strings[2];
arcdiz.text:=memo1.Lines.Strings[3];
ivirdir.text:=memo1.Lines.Strings[4];
wordexcel.text:=memo1.Lines.Strings[5];
end;
procedure TForm2.FormDblClick(Sender: TObject);
begin
form2.Show;
end;
procedure TForm2.FormShow(Sender: TObject);
begin
//viddiz.Text:=memo1.Lines.ValueFromIndex[0];
//sesdiz.Text:=memo1.Lines.ValueFromIndex[1];
//imgdiz.Text:=memo1.Lines.ValueFromIndex[2];
//arcdiz.Text:=memo1.Lines.ValueFromIndex[3];
end;
procedure TForm2.imgdizChange(Sender: TObject);
begin
memo1.Lines.Strings[2]:=imgdiz.Text;
dizinkaydet;
end;
procedure TForm2.ivirdirChange(Sender: TObject);
begin
memo1.Lines.Strings[4]:=ivirdir.Text;
dizinkaydet;
end;
procedure TForm2.sesdizChange(Sender: TObject);
begin
memo1.Lines.Strings[1]:=sesdiz.Text;
dizinkaydet;
end;
procedure TForm2.viddizChange(Sender: TObject);
begin
memo1.Lines.Strings[0]:=viddiz.Text;
dizinkaydet;
end;
procedure TForm2.wordexcelChange(Sender: TObject);
begin
memo1.Lines.Strings[5]:=wordexcel.Text;
dizinkaydet;
end;
procedure tform2.dizinkaydet;
begin
memo1.Lines.SaveToFile(’C:\\\\\\\\Program Files\\\\\\\\ayristirici\\\\\\\\dirlist.lst’);
end;
end.
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,shellapi;
type
Tklasor = class(TForm)
Button1: TButton;
ComboBox1: TComboBox;
dizin: TLabel;
procedure Button1Click(Sender: TObject);
function CopyDir(const fromDir, toDir: string): Boolean;
function MoveDir(const fromDir, toDir: string): Boolean;
function DelDir(dir: string): Boolean;
private
{ Private declarations }
public
{ Public declarations }
end;
var
klasor: Tklasor;
implementation
uses Unit2, Unit1;
{$R *.dfm}
function tklasor.CopyDir(const fromDir, toDir: string): Boolean;
var
fos: TSHFileOpStruct;
begin
ZeroMemory(@fos, SizeOf(fos));
with fos do
begin
wFunc := FO_COPY;
fFlags := FOF_FILESONLY;
pFrom := PChar(fromDir + #0);
pTo := PChar(toDir)
end;
Result := (0 = ShFileOperation(fos));
end;
function tklasor.MoveDir(const fromDir, toDir: string): Boolean;
var
fos: TSHFileOpStruct;
begin
ZeroMemory(@fos, SizeOf(fos));
with fos do
begin
wFunc := FO_MOVE;
fFlags := FOF_FILESONLY;
pFrom := PChar(fromDir + #0);
pTo := PChar(toDir)
end;
Result := (0 = ShFileOperation(fos));
end;
function tklasor.DelDir(dir: string): Boolean;
var
fos: TSHFileOpStruct;
begin
ZeroMemory(@fos, SizeOf(fos));
with fos do
begin
wFunc := FO_DELETE;
fFlags := FOF_SILENT or FOF_NOCONFIRMATION;
pFrom := PChar(dir + #0);
end;
Result := (0 = ShFileOperation(fos));
end;
procedure tklasor.Button1Click(Sender: TObject);
var
dir:string;
begin
//
//-----
//Image
//Audio
//Archive
if ComboBox1.ItemIndex=0 then
dir:=form2.viddiz.text;
if ComboBox1.ItemIndex=1 then
dir:=form2.imgdiz.text;
if ComboBox1.ItemIndex=2 then
dir:=form2.sesdiz.text;
if ComboBox1.ItemIndex=3 then
dir:=form2.arcdiz.text;
if combobox1.ItemIndex=4 then
dir:=form2.ivirdir.Text;
if combobox1.ItemIndex=5 then
dir:=form2.wordexcel.Text;
if CopyDir(dizin.Caption,dir ) = True then
begin
DelDir(dizin.Caption);
klasor.close;
end;
end;
end.