Copiar Arquivos ou Pastas...(Urgente)..

Delphi

03/09/2003

Olá pessoal,

Preciso fazer um programinha simples que copie arquivos ou pastas de um lugar definido pelo usuário até outro lugar definido pelo usuário.

Se alguém puder me ajudar

Desde já meus agradecimentos..

Edinei


Edineidaniel

Edineidaniel

Curtidas 0

Respostas

Aristodemo

Aristodemo

03/09/2003

(ShellApi)

procedure CopyDir(const cFrom, cTo: string);
var
OpStruc: TSHFileOpStruct;
frombuf, tobuf: array[0..128] of Char;
begin
FillChar(frombuf, Sizeof(frombuf), 0);
FillChar(tobuf, Sizeof(tobuf), 0);
StrPCopy(frombuf, cFrom);
StrPCopy(tobuf, cTo);
with OpStruc do
begin
Wnd := Application.Handle;
wFunc := FO_COPY;
pFrom := @frombuf;
pTo := @tobuf;
fFlags := FOF_NOCONFIRMATION or FOF_RENAMEONCOLLISION;
fAnyOperationsAborted := False;
hNameMappings := nil;
lpszProgressTitle := nil;
end; // with
ShFileOperation(OpStruc);
end; // CopyDir


GOSTEI 0
POSTAR