// redraw the portion of the window that was just painted over with the rotating star,
// but specify RDW_NOERASE to keep the desktop from drawing the background as well
RECT rc = {posX-50, posY-50, posX+50, posY+50};
RedrawWindow( hWnd, &rc, NULL, RDW_NOERASE | RDW_INVALIDATE | RDW_UPDATENOW );
I think that this code is incorrect, because I think that the RDW_NOERASE and RDW_INVALIDATE flags cannot be mixed, am I right?
No other flags are required for RDW_NOERASE to be valid. The fact that they are grouped in the documentation separately doesn't have anything to do with whether the flags may be mixed.