Ver Mensaje Individual
  #2  
Antiguo 27-05-2005
Avatar de Investment
Investment Investment is offline
Miembro
 
Registrado: may 2003
Posts: 378
Reputación: 21
Investment Va por buen camino
El truco 325 de trucomania te dice como copiar un directorio y sus subdirectorios y ficheros. Te lo reproduzco:

Código:
-Incluye ShellApi en el uses de tu form

procedure TForm1.Button1Click(Sender: TObject);
 
  function CopiaTodo(Origen,Destino : String) :
  LongInt;
  var 
	F : TShFileOpStruct;
	sOrigen, sDestino : String;
  begin 
	Result := 0;
	sOrigen := Origen + #0;
	sDestino := Destino + #0;
 
	with F do 
	begin 
	  Wnd   := Application.Handle;
	  wFunc := FO_COPY;
	  pFrom := @sOrigen[1];
	  pTo   := @sDestino[1];
	  fFlags := FOF_ALLOWUNDO or FOF_NOCONFIRMATION
	end; 
 
	Result := ShFileOperation(F);
end; 
 
begin 
  CopiaTodo('c:\Delphi3\*.*','c:\kk');
end;
__________________
Saludos,
Peter Investment
Responder Con Cita