Solution of no response of progress bar in MFC program

The MFC program written a few days ago, the progress bar will not respond when the program is running to deal with large tasks. It will be updated again only at the end of processing, and it will be directly updated to the full status of the progress bar, which is very unpleasant. Today, running MFC program again, I really can’t stand this situation. It’s very easy to find information on the Internet and get a solution.

reference resources

MSG msg;


while(PeekMessage(& msg,NULL,0,0,PM_ REMOVE))


TranslateMessage(& msg);

DispatchMessage(& msg);


The problem can be solved by adding the above code before the program loop processing task, and the progress bar can be updated continuously. As for the inherent principle of the solution, there is probably an understanding about MFC message circulation and message pump.

Read More: