|
'************************************************
'** 函数名称: uCopyFile
'** 函数功能: 复制文件
'** 参数说明:
'** strFrom 源文件
'** strTo 目标文件
'** prgState 进度条控件
'** lblState 用来显示进度的 Label
'** 函数返回:
'** Boolean 类型
'** True 复制成功
'** False 复制失败
'** 参考实例:
'**
'** blnReturn = uCopyFile("c:\test.exe", "d:\test.exe", prgState, lblState)
'************************************************
Public Function uCopyFile(ByVal strFrom As String, _
ByVal strTo As String, _
ByRef prgState As Object, _
ByRef lblState As Object) As Boolean
Dim lngReturn As Long
Set mprgState = prgState
Set mlblState = lblState
'// 开始复制
lngReturn = CopyFileEx(strFrom, strTo, _
AddressOf CopyProgressRoutine, ByVal 0&, mlngCancel, COPY_FILE_RESTARTABLE)
If lngReturn = 0 Then
uCopyFile = False
Else
uCopyFile = True
End If
End Function |
|