I use scrollbar to show a large piece of data with many lines (for some background please refer to my previous question: MFC: how to reduce the time cost of OnInitialUpdate() for scrolling?).
The scrolling function works fine when: (1) clicking on arrow button, (2) clicking on scroll shaft or (3) rolling the mouse wheel; the content moves upwards or downwards correctly. But when I drag the scroll thumb, it doesn't really behave as expected unless very tiny distance.
When dragging a little bit more, e.g. forward, it could jump back and sometimes all the way to the beginning. It never stays when mouse released, and I never successfully drag the thumb all the way to the last record.
As I take closer look, "GetClipBox(...)" seems not return correct data. For example, if I drag all the way to the end, this function would return rect.top equals to zero. Since I rely on the return value to calculate the set of records to draw, the rest is messed up.
A minimal reproducible example can be accessed here: https://138.197.210.223/test/My.tar.gz. When testing, drag thumb all the way to the end for better effect.