还是sanhen厉害!方法不错,简单实用。
我这里有我论坛7猫给我的一段用于复制文件显示进度条的AU3代码,共同交流吧
Global Const $FO_COPY = 0x0002
Global Const $FOF_ALLOWUNDO = 0x0040
_ExplorerCopy("f:\XPBAK.gho", "D:\")
Func _ExplorerCopy($source, $dest)
Local $SHFILEOPSTRUCT, $source_struct, $dest_struct
$SHFILEOPSTRUCT = DllStructCreate("hwnd hWnd;uint wFunc;ptr pFrom;ptr pTo;int fFlags;" & _
"int fAnyOperationsAborted;ptr hNameMappings;ptr lpszProgressTitle")
$source_struct = DllStructCreate("char[" & StringLen($source) + 2 & "]")
DllStructSetData($source_struct, 1, $source)
DllStructSetData($source_struct, 1, 0, StringLen($source) + 2)
$dest_struct = DllStructCreate("char[" & StringLen($dest) + 2 & "]")
DllStructSetData($dest_struct, 1, $dest)
DllStructSetData($dest_struct, 1, 0, StringLen($dest) + 2)
DllStructSetData($SHFILEOPSTRUCT, "hWnd", 0)
DllStructSetData($SHFILEOPSTRUCT, "wFunc", $FO_COPY)
DllStructSetData($SHFILEOPSTRUCT, "pFrom", DllStructGetPtr($source_struct))
DllStructSetData($SHFILEOPSTRUCT, "pTo", DllStructGetPtr($dest_struct))
DllStructSetData($SHFILEOPSTRUCT, "fFlags", $FOF_ALLOWUNDO)
DllCall("shell32.dll", "int", "SHFileOperation", "ptr", DllStructGetPtr($SHFILEOPSTRUCT))
EndFunc ;==>_ExplorerCopy
[ 本帖最后由 skyfree 于 2008-7-29 15:03 编辑 ] |