-
Repaint
I'm trying to have my program repaint in a loop, but it only waits until the loop is done to redraw. Here's my code:
Code:
while( ftell( fIn ) < fileSize ) {
ZeroMemory( pszBuffer, 512 );
fread( pszBuffer, 512, sizeof( char ), fIn );
//do stuff
fwrite( pszBuffer, 512, sizeof( char ), fOut );
setProgress( progress + 512 );
RECT rect;
GetWindowRect(hWnd, &rect);
InvalidateRect(hWnd, &rect, true);
}
-
Basically you're posting a WM_PAINT message with InvalidateRect, however you are still doing stuff in a loop so the message isn't being processed. If this is in another thread then the code would probably work.