标签:sed ase nat signed ota msi names iostream bytes
#include <iostream> #include <windows.h> using namespace std; unsigned long long translate(LARGE_INTEGER num) { unsigned long long reslut = num.HighPart; reslut << 32; reslut += num.LowPart; return reslut; } DWORD CALLBACK CopyProgress( LARGE_INTEGER TotalFileSize, // total file size, in bytes LARGE_INTEGER TotalBytesTransferred, // total number of bytes transferred LARGE_INTEGER StreamSize, // total number of bytes for this stream LARGE_INTEGER StreamBytesTransferred, // total number of bytes transferred for this stream DWORD dwStreamNumber, // the current stream DWORD dwCallbackReason, // reason for callback HANDLE hSourceFile, // handle to the source file HANDLE hDestinationFile, // handle to the destination file LPVOID lpData // passed by CopyFileEx ) { unsigned long long total = translate(TotalFileSize); unsigned long long copied = translate(TotalBytesTransferred); printf("进度:%I64d / %I64d \n", copied, total); return PROGRESS_CONTINUE; } int main() { BOOL ss = CopyFileEx("D:\\BaiduNetdiskDownload\\123.exe", "c:\\111111_copy.txt", &CopyProgress, NULL, NULL, NULL); cout << (ss ? "ture" : "flase"); return 0; }
标签:sed ase nat signed ota msi names iostream bytes
原文地址:https://www.cnblogs.com/shenji/p/12402898.html