If I this function:

void drawRect(int x1, int y1, int x2, int y2){
    HDC screenDC = ::GetDC(0);
    ::Rectangle(screenDC, x1, y1, x2, y2);
    ::ReleaseDC(0, screenDC);
}

How would I clear the screen of the white rectangles ?
Can I make them another color ? :)

Redraw them in the same color as the background. Or I suppose you could save a bitmap of the entire screen before you start drawing the rectangles and redraw the screen with that bipmap when you want to clear it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.