1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
DWORD ret = PROGRESS_CONTINUE;
CMyCopyFileDlg* ptr = (CMyCopyFileDlg*)lpData;
// On calcule un pourcentage pour la progression du fichier
DWORD percent = (TotalBytesTransferred.QuadPart * 100) / TotalFileSize.QuadPart;
ptr->m_progressFile.SetPos(percent);
DWORD left = TotalFileSize.QuadPart - TotalBytesTransferred.QuadPart;
// On prépare une string avec les données transférées et restantes...
ptr->m_strAvancementFic.Format("%d bytes copied, left : %d bytes",
TotalBytesTransferred.QuadPart, left);
CRect rect;
[b]
ptr->GetClientRect(rect);
ptr->InvalidateRect(rect, FALSE);
[/b]
AfxGetApp()->PumpMessage();
ptr->UpdateData(FALSE);
if ( ptr->m_annuleCopie == TRUE )
{
ret = PROGRESS_CANCEL;
}
return ret; |
Partager