quote:Original post by RuneLancer Just send a WM_PAINT message to your program
A better option is to call .invalidate() on the component that needs redrawing. This means that the redraw event comes in at a suitable time (and may be merged with an already queued repaint event).
Another thing you might want to change is the use of BeginPaint - it is a special function that sets clipping values so you only update the part of the window that needs repainting (when the WM_PAINT message is called). If you want to draw anywhere on the window, you probably want to use GetDC and ReleaseDC instead.
Also, as has been mentioned, you might want to do double buffering to avoid flicker. In order to do that, you need to use CreateCompatibleDC to make a new DC, then CreateCompatableBitmap to make a buffer for it, then SelectObject to tell the compatable DC to use the compatable Bitmap: