New to Windows & C++ - InvalidateRect Problem
I'm making little excersizes for myself just to explore programming C++ in windows. I made a little app to show the mouse coordinates next to the cursor as I moved it but didn't like the way it made the entire screen flicker. So I decided to try giving InvalidateRect an hRgn. (type RECT)
The code below has been adjusted for testing. A rectangle appears at the mouse pointer. BUT it only seems to appear when the x and y coordinates are close to the same. So you get unearased fragments of the box from 0,0 and continuing 0+1, 0+1... etc in a diaginal line down the window?!?!
I read the technote on normalization of RECT and tried that with no positive results. Can anyone tell me what I'm missing?
hdc = BeginPaint(hWnd, &ps);
TextOut(hdc,120,30,"<- a few lines ->",17);
TextOut(hdc,470,30," A Chord ->",11);
TextOut(hdc,350,80,"<- A Pie Wedge", 14);
TextOut(hdc,710,350,"<- A Rectangle",14);
// coords is of type RECT
coords.left = y;
coords.top = x;
coords.bottom = x+40;
coords.right = y+40;