programmershelp source code examples for asp, php, perl, delphi, c, c++, visual basic, java and others
programmershelp source code examples for asp, php, perl, delphi, c, c++, visual basic, java and others
programmershelp source code examples for asp, php, perl, delphi, c, c++, visual basic, java and others
   Main Menu
programmershelp source code examples for asp, php, perl, delphi, c, c++, visual basic, java and others

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript Site
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

US Job listings




   Misc
programmershelp source code examples for asp, php, perl, delphi, c, c++, visual basic, java and others

   Amazon
programmershelp source code examples for asp, php, perl, delphi, c, c++, visual basic, java and others

   Links
programmershelp source code examples for asp, php, perl, delphi, c, c++, visual basic, java and others

programmershelp source code examples for asp, php, perl, delphi, c, c++, visual basic, java and others
Code examples are sponsored by Webmastersearn : make money with your website

 

copy a file

copy a file

'copy a file

Public Type SHFILEOPSTRUCT
hWnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAnyOperationsAborted As Boolean
hNameMappings As Long
lpszProgressTitle As String
End Type

Public Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Public Const FO_COPY = &H2
Public Const FOF_ALLOWUNDO = &H40

Public Sub CopyFileWindowsWay(SourceFile As String, DestinationFile As String)

Dim lngReturn As Long
Dim typFileOperation As SHFILEOPSTRUCT

With typFileOperation
.hWnd = 0
.wFunc = FO_COPY
.pFrom = SourceFile & vbNullChar & vbNullChar 'source file
.pTo = DestinationFile & vbNullChar & vbNullChar 'destination file
.fFlags = FOF_ALLOWUNDO
End With

lngReturn = SHFileOperation(typFileOperation)

If lngReturn <> 0 Then 'Operation failed
MsgBox Err.LastDllError, vbCritical Or vbOKOnly
Else 'Aborted
If typFileOperation.fAnyOperationsAborted = True Then
MsgBox "Operation Failed", vbCritical Or vbOKOnly
End If
End If

End Sub



Clickbank mall, make money
sell software, make money
Hosted magazine site : make money with no website



 


 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
clear recent documents list(Visual Basic)
vertical scrolling text(Darkbasic)
expanding text(Javascript)
getprotobynumber function(PHP)
Datediff example(ASP)
Check email address using Regular expressions(ASP)
Shut down your PC(VB)
checks for free diskdrive's and add them to a combobox(VB)




Copyright © 2004 by programmershelp.co.uk