I'm trying to draw what amounts to six filled focus rectangles. They need to be drawn in such a way that they're always visible, regardless of the background colour. The problem I'm coming up against is when the background colour is grey (RGB 128 128 128). NOTing that gives you effectively the same colour, and XOR is all well and good but it doesn't seem work in all cases.
Currently I'm using:-
This XORs the colours of the selected brush (the default, black) with the rectangle indicated. The result is invisible with a grey background. Changing the brush to white makes no difference, so a change in ROP code is in order I believe.Code:PatBlt(hdc, x, y, width, height, PATINVERT);