On Windows-7 my application receives continuous repaint events from windows. I am using wxWidgets.
The problem does not occur:
in debug mode of Visual Studio (2010)
The problem only occurs in Widows-7 when the app is redrawing a lot and it takes more than 5 seconds to draw. If I turn off some of what needs to be redrawn, and it doesn't take as long, it is fine.
I am calling wxPaintDC dc(this);
in the paint event handler so this is not the problem.
I tried DwmFlush
as well. I put it in the repaint event handler and also in the drawing code.
Using wxYield in the draw loop seemed to do the trick. Thank you for the input.