MFC拷贝文件及进度条显示

参考:封装CopyFileEx函数,实现文件复制中的暂停,控速,获取进度。

http://blog.csdn.net/career2011/article/details/6844513

实例讲解C++中CopyFileEx函数的简单用法

http://www.exam8.com/computer/djks/dj2/C/ziliao/200903/1316720.html

MFC文件拷贝

http://www.docin.com/p-345226047.html

如何使用CopyFileEx

http://book.77169.com/57/28338.htm

如果希望可以用进度条显示文件复制的进度,则用CopyFileEx函数

使用CopyFileEx函数,原型:
BOOL CopyFileEx(
  LPCTSTR lpExistingFileName,           // name of existing file
  LPCTSTR lpNewFileName,                // name of new file
  LPPROGRESS_ROUTINE lpProgressRoutine, // callback function
  LPVOID lpData,                        // callback parameter
  LPBOOL pbCancel,                      // cancel status
  DWORD dwCopyFlags                     // copy options
);
lpProgressRoutine 参数用于传递回调函数,lpData是回调函数的附加参数,有一定VC基础的话不难理解。

CopyProgressRoutine原型:
DWORD CALLBACK CopyProgressRoutine(
  LARGE_INTEGER TotalFileSize,          // file size
  LARGE_INTEGER TotalBytesTransferred,  // bytes transferred
  LARGE_INTEGER StreamSize,             // bytes in stream
  LARGE_INTEGER StreamBytesTransferred, // bytes transferred for stream
  DWORD dwStreamNumber,                 // current stream
  DWORD dwCallbackReason,               // callback reason
  HANDLE hSourceFile,                   // handle to source file
  HANDLE hDestinationFile,              // handle to destination file
  LPVOID lpData                         // from CopyFileEx
);



你可能感兴趣的:(MFC拷贝文件及进度条显示)