$tagSHFileOperation = "hwnd hwndOwner;uint wFunc;ptr From;ptr To;" & _
"dword Flags;int AnyOperationAborted;" & _
"hwnd NameMapping;ptr ProgressTitle"
$tFileOperation = DllStructCreate($tagSHFileOperation)
$sFrom = "C:\14th destination.rmvb" ; 源文件
$From = DllStructCreate("wchar[" & StringLen($sFrom) + 2 & "]")
DllStructSetData($From, 1, $sFrom)
$pFrom = DllStructGetPtr($From)
$sTo = @ScriptDir ; 目的文件
$To = DllStructCreate("wchar[" & StringLen($sTo) + 2 & "]")
DllStructSetData($To, 1, $sTo)
$pTo = DllStructGetPtr($To)
DllStructSetData($tFileOperation, 1, 0)
DllStructSetData($tFileOperation, 2, 0x2) ; $fo_copy = 0x2
DllStructSetData($tFileOperation, "From", $pFrom)
DllStructSetData($tFileOperation, "To", $pTo)
DllStructSetData($tFileOperation, "Flags", 0x40) ; $fof_allowundo = 0x40
DllCall("shell32.dll", "int", "SHFileOperationW", _
"ptr", DllStructGetPtr($tFileOperation))
|