013
16.09.2003, 10:23 Uhr
~proga
Gast
|
In Wirklichkeit war das hier meine Funktion zum Kopieren...
C++: |
/****************************************************************** * Copying file is running in an own thread */ DWORD WINAPI CopyThread(LPVOID lpThreadParameter) { BOOL bCancel = FALSE; DWORD CopyFlags = 0; BOOL bResult = CopyFileEx(chFNDest, FullPath, CopyProgressRoutine, NULL, &bCancel, CopyFlags);
if (bResult) { // delete file remove(chFNDest); Sleep(4000); } else { ShowError(); }
ExitThread(bResult); }
|
und hier die Callbackfunktion...
C++: |
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 ) { int nPos = (TotalBytesTransferred.LowPart * 100) / TotalFileSize.LowPart; SendMessage(hProgressBar, PBM_SETPOS, nPos, 0L); return PROGRESS_CONTINUE; }
|
vielleicht hilft dir das weiter |