Generally: do not draw somewhere outside WM_PAINT.
Instead store the string that you want to draw somewhere.
If you want to change that stored string you need to InvalidateRect() the current portion of the window, change the string and InvalidateRect() the new portion of the window.
InvalidateRect() can erase the background for you so no need to erase the not overwritten protion yourself. But it may cause flicker
In WM_PAINT you just need to draw the stored string.
im not really sure how to use this invalidaterect() i tried the code above, it works on repainting the winoow but i still have the ovelaping text problem