i know how to repaint the full window but i don’t know how to repaint a pieace of window like i draw a squre using gdi+ than i want to change it’s coordinates so i want to repaint the squre not the whole window
anyidea?
i also tried this
RECT rect2;
rect2.left=0;
rect2.top=100;
rect2.right=225;
rect2.bottom=300;
InvadiateRect(hwnd, &rect2, false);
it still repaint the whole window
One way to do this is to call
InvalidateRect()with a rectangle that is large enough to cover both the old and new positions of the square you moved. Windows will then call yourWM_PAINThandler to repaint the area of the screen that changed.The
UnionRect()function is helpful for calculating this repaint rectangle.