Fixed the problem with WM_PAINT.

Need to call Begin/EndPaint.