Sign in to follow this  
Followers 0
zFrank

I Think You can Really Help me

3 posts in this topic




zFrank

Try this:

Global Const $PROGRESS_CONTINUE = 0
Global Const $PROGRESS_CANCEL   = 1
Global Const $PROGRESS_STOP     = 2
Global Const $PROGRESS_QUIET    = 3

_FileCopyEx("d:\Video\Clips\New\02.avi", "c:\02.avi")

Func _FileCopyEx($Source, $Dest)
    If Not FileExists($Source) Then Return SetError(1, 0, 0)
    
    ProgressOn("_FileCopyEx() Demo", "Copy, please wait...")
    
    $pCopyProgressRoutine = DllCallbackRegister("_CopyProgressRoutine", "int", "uint64;uint64;uint64;uint64;dword;dword;ptr;ptr;ptr")
    
    DllCall("kernel32.dll", "int", "CopyFileEx", _
        "str", $Source, _
        "str", $Dest, _
        "ptr", DllCallbackGetPtr($pCopyProgressRoutine), _
        "ptr", 0, _
        "int", 0, _
        "int", 0)
    
    DllCallbackFree($pCopyProgressRoutine)
    Sleep(1000)
    ProgressOff()
EndFunc

Func _CopyProgressRoutine($TotalFileSize, $TotalBytesTransferred, $StreamSize, $StreamBytesTransferred, $dwStreamNumber, $dwCallbackReason, $hSourceFile, $hDestinationFile, $lpData)
    $Percent = $TotalBytesTransferred / $TotalFileSize * 100
    
    ProgressSet($Percent, "Percent: " & Round($Percent, 1) & "%")
    
    Return $PROGRESS_CONTINUE
EndFunc   ;==>_CopyProgressRoutine

MSDN:

CopyFileEx

CopyProgressRoutine

Share this post


Link to post
Share on other sites

Nice example @rasim!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0