One possibility is to simply pass FALSE as the last parameter to InvalidateRect. Passing TRUE, as you're doing, erases the background.

A more far-reaching solution is to maintain a data structure...