My custom Win32 control invalidates (using InvalidateRect()
) precisely the regions for which it knows they require repainting.
The control also allows users to hook an overlay event, allowing them to draw on the paint DC while handling WM_PAINT
. The control itself cannot predict where the user will draw, and thus cannot invalidate this region up front.
The problem I'm now facing is that the area painted during the overlay event gets clipped against the region of my client area which is invalidated. Attempts to remove any clipping did not work, e.g. SelectClipRgn()
with a NULL HRGN.
Is there any way around this, other than always invalidating the entire client rect and thereby sacrificing performance?