|
-
Nov 7th, 2001, 07:26 AM
#1
Thread Starter
New Member
SHFILEOPSTRUCT problem
I am using this api to copy files from one location to another
However if the files already exist in the destination location I want the program to ask me if it is ok to overwrite the existing files
I have read all about the different flags used with this api but I can find nothing about overwrittihg files
can this be done
code
Dim fos As SHFILEOPSTRUCT
Dim sa(1 To 32) As Byte
Dim retval As Long
With fos
.hWnd = Form1.hWnd
.wFunc = FO_COPY
.pFrom = C:\test\*.* & vbNullChar & vbNullChar
.pTo = C:\temp & vbNullChar & vbNullChar
.fFlags = FOF_SIMPLEPROGRESS Or FOF_ALLOWUNDO
.fAnyOperationsAborted = 0
.hNameMappings = 0
End With
CopyMemory sa(1), fos, LenB(fos)
CopyMemory sa(19), sa(21), 12
retval = SHFileOperation(sa(1))
CopyMemory sa(21), sa(19), 12
CopyMemory fos, sa(1), Len(fos)
Thanks for your time
-
Nov 7th, 2001, 07:34 AM
#2
How about running code, before your copy operation, to check to see if the file exists? If it does, then before you call your copy operation, popup a message verifying the copy.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|