Форум: "Основная";
Текущий архив: 2002.04.25;
Скачать: [xml.tar.bz2];
ВнизВ чем error? Найти похожие ветки
← →
Schummi (2002-03-30 08:12) [0]
function FileOperation(FileListBox:TFileListBox;ToPath:string;Action:integer):boolean;
{копирование, перемешение и удаление}
var SHFO: TSHFileOpStruct;
i,c : integer;
FromPath,st,fn : string;
begin
with SHFO do begin
wnd := Application.Handle;
wFunc := Action;
FromPath:= "";
c:=FileListBox.Items.Count-1;
for i:=0 to c do
begin
st:=FileListBox.Items.Strings[i];
Fn:=FavorPath+Form1.ListBox1.Items.Strings[Form1.ListBox1.ItemIndex]+st;
if FileListBox.Selected[i] then
FromPath:=FromPath+Fn+#0;
end;
{FromPath := FromPath+#0;}
pFrom := PChar(FromPath);
pTo := PChar(ToPath);
fFlags := FOF_ALLOWUNDO;
end;
Result := SHFileOperation(SHFO)=0;
end;
...
procedure TForm1.ListBox1DragDrop(Sender, Source: TObject; X, Y: Integer);
var T:Integer;Selected:String;FileL:TFileListBox;
begin
FileL:=Source as TFileListBox;
T:=FileListBox1.TopIndex;
Selected:=FavorPath+ListBox1.Items.Strings[(Y div ListBox1.ItemHeight)+ListBox1.topindex];
ShowMessage(Selected);
case CheckListBox1.Checked[5] of
True:FileOperation(FileL,Selected,FO_MOVE);
False:FileOperation(FileL,Selected,FO_COPY);
end;
FileListBox1.Update;
FileListBox1.TopIndex:=t;
StatusBar1.SimplePanel:=True;
StatusBar1.SimpleText:="Всего файлов в этой папке: "+IntToStr(FileListBox1.Items.Count);
end;
Заранее спасибо!
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2002.04.25;
Скачать: [xml.tar.bz2];
Память: 0.44 MB
Время: 0.01 c