本帖最后由 xg911335 于 2010-9-27 15:27 编辑 Func _Start($SourceFile, $DestFile,$Overall)
$pCopyProgressRoutine = DllCallbackRegister("_CopyProgressRoutine", "int", "uint64;uint64;uint64;uint64;dword;dword;ptr;ptr;ptr")
DllCall("kernel32.dll", "int", "CopyFileEx", _
"str", $SourceFile, _
"str", $DestFile, _
"ptr", DllCallbackGetPtr($pCopyProgressRoutine), _
"ptr", 0, _
"int", 0, _
"int", 0)
DllCallbackFree($pCopyProgressRoutine)
EndFunc
Func _CopyProgressRoutine($TotalFileSize, $TotalBytesTransferred, $StreamSize, $StreamBytesTransferred, $dwStreamNumber, $dwCallbackReason, $hSourceFile, $hDestinationFile, $lpData)
$Percent = $TotalBytesTransferred / $TotalFileSize * 100
GUICtrlSetData($Progress0Text, "Total Progress1 " & Round($Percent, 1) & "% completed1")
GUICtrlSetData($Progress1,$Percent)
Return $PROGRESS_CONTINUE
EndFunc
这段代码我修改了一下,使其可以复制整个文件夹,但进度条显示的是每个文件的百分比,这样我就看不见总的百分比了。我想让它显示整个文件夹复制的百分比?如何控制进度。 |