Resumen Copiar ficheros y directorios


Hola jaramillo..
por aqui te envio una informacion de copiar en windows
animadamente, con las hojas que vuelan ojala que te sirva...
Esta en Ingles...


How To Use the Animated Copy Functions in Windows 95

PSS ID Number: Q151799
Article last modified on 06-18-1996
PSS database name: VBWIN

4.00

WINDOWS


----------------------------------------------------------------------
-- The information in this article applies to:

 - Standard, Professional, and Enterprise Editions of Microsoft
   Visual Basic, 32-bit only, for Windows, version 4.0
----------------------------------------------------------------------
--

SUMMARY
=======

The Windows API provides the ability to perform a copy, move, rename,
or delete operation on a file system object using the SHFileOperation
function that is exported by Shell32.dll. The example below shows how
to copy a list of files into a named folder. The SHFileOperation
provides the ability to move, rename, or delete based on the flags
passed to it. For more information on what options are available, see
the References section at the end of this article.

MORE INFORMATION
================

The following example creates a single form Visual Basic project using
the SHFileOperation API function:

Step-by-Step Example
--------------------

1. Start Visual Basic. Form1 is created by default.

2. Place a Command Button on Form1.

3. From the Insert menu, select Module to add a single code module to
the
   project.

4. Add the following code, consisting of function, type, and constant
   declarations, to Module1:

   Public Const FO_MOVE As Long = &H1
   Public Const FO_COPY As Long = &H2
   Public Const FO_DELETE As Long = &H3
   Public Const FO_RENAME As Long = &H4

   Public Const FOF_MULTIDESTFILES As Long = &H1
   Public Const FOF_CONFIRMMOUSE As Long = &H2
   Public Const FOF_SILENT As Long = &H4
   Public Const FOF_RENAMEONCOLLISION As Long = &H8
   Public Const FOF_NOCONFIRMATION As Long = &H10
   Public Const FOF_WANTMAPPINGHANDLE As Long = &H20
   Public Const FOF_CREATEPROGRESSDLG As Long = &H0
   Public Const FOF_ALLOWUNDO As Long = &H40
   Public Const FOF_FILESONLY As Long = &H80
   Public Const FOF_SIMPLEPROGRESS As Long = &H100
   Public Const FOF_NOCONFIRMMKDIR As Long = &H200

   Type SHFILEOPSTRUCT
           hwnd As Long
           wFunc As Long
           pFrom As String
           pTo As String
           fFlags As Long
           fAnyOperationsAborted As Long
           hNameMappings As Long
           lpszProgressTitle As String
   End Type
   Declare Function SHFileOperation Lib "Shell32.dll" _
       Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long

5. Add the following to the Command1 Click event:

   Private Sub Command1_Click()
       Dim result As Long
       Dim fileop As SHFILEOPSTRUCT

       With fileop
           .hwnd = Me.hwnd

           .wFunc = FO_COPY

           ' The files to copy separated by Nulls and terminated by 2
           nulls .pFrom = "C:\PROGRAM FILES\MICROSOFT VISUAL
           BASIC\VB.HLP" & _
                vbNullChar & _
                "C:\PROGRAM FILES\MICROSOFT VISUAL BASIC\README.HLP" &
                _ vbNullChar & vbNullChar

           ' or to copy all files use this line
           '.pFrom = "C:\*.*" & vbNullChar & vbNullChar

           ' The directory or filename(s) to copy into terminated in 2
           ' nulls .pTo = "C:\testfolder\" & vbNullChar & vbNullChar

           .fFlags = FOF_SIMPLEPROGRESS Or FOF_FILESONLY
       End With

       result = SHFileOperation(fileop)

       If result <> 0 Then ' Operation failed
           MsgBox Err.LastDllError 'Msgbox the error that occurred in
           the
                                   ' API.
       Else
           If fileop.fAnyOperationsAborted <> 0 Then
               MsgBox "Operation Failed"
           End If
       End If
   End Sub

6. From the Run menu, select Start, or press the F5 key to run the
   application. Click the button. If the file is large enough, you
   will see the copying animation. It will also prompt you to create
   the directory if it does not exist.

REFERENCES
==========

Microsoft Win32 SDK SHFileOperation, SHFILEOPSTRUCT.
Microsoft Visual Basic Language Reference, Err Object, pages
310-312.

Additional reference words: 4.00 vb4win vb432
KBCategory: kbprg kbhowto
KBSubcategory: APrgOther

======================================================================
======= Copyright Microsoft Corporation 1996.


Sige los pasos y funcione...
Suerte...










> From: "Rodrigo A. Jaramillo Restrepo" <rjaramir@eeppm.com>
> To: "'vb-esp@ccc.uba.ar'" <vb-esp@ccc.uba.ar>, "'epacasan@sp.ehu.es'" <epacasan@sp.ehu.es>
> Subject: RE: (VB-ESP) Copiar ficheros y directorios
> Date: Wed, 17 Dec 1997 08:23:34 -0500
> Reply-to: vb-esp@ccc.uba.ar

> Rodrigo A. Jaramillo Restrepo
> Ingeniero de Sistemas
> E-Mail : rjaramir@eeppm.com
> Tel 361 21 94 - - - 361 22 36
> Medellín - Colombia
>
>
>     UTILIZA
>
>
> utiliza
> > w=shell("command.com /c xcopy d:\anon d:\tmp /s /e",1)
> >
> > ----------
> > De:     Narciso Calvo Salomon[SMTP:epacasan@sp.ehu.es]
> > Responder a:     vb-esp@ccc.uba.ar
> > Enviado el:     Lunes 15 de Diciembre de 1997 6:09 AM
> > Para:     vb-esp@ccc.uba.ar
> > Asunto:     (VB-ESP) Copiar ficheros y directorios
> >
> > Hola a todos.
> >
> > Estoy haciendo una aplicacion en la que tengo que copiar unos 3000
> > ficheros repartidos en unos 50 directorios y subdirectorios, por lo
> > que
> > he pasado de usar FileCopy (demasiado complicado) Y he optado por
> > hacerlo desde DOS con el comando xcopy de la siguiente manera:
> >
> > Shell ("xcopy d:\anon d:\tmp /s /e")
> >
> > El problema que tengo es que no me hace nada cuando pulso el botsn que
> > debe ejecutar esta orden. ?Alguien sabe cual es el problema?
> >
> > Gracias por adelantado.
> >
>



Resumen Resumen

Visual Basic Página de Visual Basic

Página principal Página principal

www.jrubi.com