Rein Klazes wijn@wanadoo.nl writes:
In erase_now() the aptly coded endless loop is never broken out, and loops on the same window over and over. Before the change this was coded quite differently (traversing the window's child tree) and could not loop indefinitely. I am quite stuck what should be the reason why the loop is expected to end in the first place. Perhaps you want to have a look.
The loop ends because erasing the window clears the erase bits. Unfortunately in that case the app does a RedrawWindow(RDW_ERASE) inside the WM_ERASEBKGND handler, so the window is marked as needing erase again. The algorithm will probably need to be changed, but the first step would be to write a test case and see how Windows behaves in that case.