Let me add my 2ยข here, and please keep in mind that we're just trying to be helpful:
Use the WM_PAINT handler to do all your painting and drawing where practical.
It'll save you a lot of grief in the long run. Sure, you can set up code with bunches of flags and stuff, but in the end you're going to get screwed when, as JJ pointed out, someone rudely moves another window over yours and voila! big blank spots.
(I almost put in that stupid line about how the speed of light isn't just a good idea--it's the law!, but of course it ain't no law that you have to put your painting and drawing in your paint routine. But it really is the way Windoze is designed to work. Better not to fight it, I've discovered ...)
Hint: global variables are your friend here.