|
Post by Carl Gundel on Jul 12, 2018 16:14:06 GMT -5
I was looking at an old blog post and found this:
Hey Chris, you wouldn't have that code handy? I'd be happy to repost it.
Thanks.
|
|
|
Post by metro on Jul 12, 2018 18:37:39 GMT -5
Sorry to jump in here Chris & Carl, not sure if this is Chris's code. I saved it in march 2016 so maybe it is
srcPath$ = DefaultDir$ + "\bmp" dstPath$ = DefaultDir$ + "\bmpcopy" a = CopyFolder(srcPath$, dstPath$) If a = 0 then print "Copy successful!" Else print "Uh oh, something went wrong." End If
Function CopyFolder(src$, dest$) FO.COPY = 2 FOF.SILENT = 4 FOF.NOCONFIRMATION = 16 FOF.NOERRORUI = hexdec("400") FOF.NOCONFIRMMKDIR = hexdec("200") FOF.NO.UI = FOF.SILENT or FOF.NOCONFIRMATION _ or FOF.NOERRORUI or FOF.NOCONFIRMMKDIR
struct SHFILEOPSTRUCT,_ hWnd as ulong,_ wFunc as ulong,_ pFrom$ as ptr,_ pTo$ as ptr,_ fFlags as long,_ fAnyOperationsAborted as long,_ hNameMappings as long,_ lpszProgressTitle$ as long
SHFILEOPSTRUCT.hWnd.struct = 0 SHFILEOPSTRUCT.wFunc.struct = FO.COPY SHFILEOPSTRUCT.pFrom$.struct = src$ + chr$(0) + chr$(0) SHFILEOPSTRUCT.pTo$.struct = dest$ + chr$(0) + chr$(0) SHFILEOPSTRUCT.fFlags.struct = FOF.NO.UI SHFILEOPSTRUCT.hNameMappings.struct = 0 SHFILEOPSTRUCT.lpszProgressTitle$.struct = ""
CallDLL #shell32, "SHFileOperationA",_ SHFILEOPSTRUCT as struct,_ CopyFolder as long End Function
|
|
|
Post by Carl Gundel on Jul 12, 2018 19:56:14 GMT -5
Sorry to jump in here Chris & Carl, not sure if this is Chris's code. I saved it in march 2016 so maybe it is srcPath$ = DefaultDir$ + "\bmp" dstPath$ = DefaultDir$ + "\bmpcopy" a = CopyFolder(srcPath$, dstPath$) If a = 0 then print "Copy successful!" Else print "Uh oh, something went wrong." End If
Function CopyFolder(src$, dest$) FO.COPY = 2 FOF.SILENT = 4 FOF.NOCONFIRMATION = 16 FOF.NOERRORUI = hexdec("400") FOF.NOCONFIRMMKDIR = hexdec("200") FOF.NO.UI = FOF.SILENT or FOF.NOCONFIRMATION _ or FOF.NOERRORUI or FOF.NOCONFIRMMKDIR
struct SHFILEOPSTRUCT,_ hWnd as ulong,_ wFunc as ulong,_ pFrom$ as ptr,_ pTo$ as ptr,_ fFlags as long,_ fAnyOperationsAborted as long,_ hNameMappings as long,_ lpszProgressTitle$ as long
SHFILEOPSTRUCT.hWnd.struct = 0 SHFILEOPSTRUCT.wFunc.struct = FO.COPY SHFILEOPSTRUCT.pFrom$.struct = src$ + chr$(0) + chr$(0) SHFILEOPSTRUCT.pTo$.struct = dest$ + chr$(0) + chr$(0) SHFILEOPSTRUCT.fFlags.struct = FOF.NO.UI SHFILEOPSTRUCT.hNameMappings.struct = 0 SHFILEOPSTRUCT.lpszProgressTitle$.struct = ""
CallDLL #shell32, "SHFileOperationA",_ SHFILEOPSTRUCT as struct,_ CopyFolder as long End Function
Thanks, that looks right.
|
|