1
votes

In an MFC application there is a small rectangular region where the scroll bars meet (bottom right of the window). It seems that this region only invalidates when the frame is resized. On other occasions (for example, if another window is dragged over it), this region does not repaint.

I've been able to reproduce it in VS 6 and 2008 on newly created projects. I've also seen some commercial apps with the same problem. To recreate it:

  1. Create a new SDI project with a CScrollView derived view.
  2. Resize the window so that both scroll bars are shown.
  3. Drag another window over that rectangle to see the repaint problem.

Any ideas how to get rid of this?

1
I believe that your issue demo, especially part 3, has as a prerequisite that the "Show window contents while dragging" is selected.tzot
Not necessarily. You can also simply drag the first window (the MFC program) off screen and back and the rectangle won't invalidate.Alf Zimmerman

1 Answers

1
votes

One work around would be to trap the OnPaint method of the CScrollView and in this method add code to always paint the bottom corner of the client window.

But this painting code would also need to call GetDC to get a new CDC, so that it can bypass the clipping regions of the BeginPaint CDC passed in by the WM_PAINT message.