Quite a simple query this one, I hope:
I have a scrollbar derived from CScrollbar. In this case, it is a vertical scrollbar. I want to get the window rectangle of the scroll thumb (the bit we can drag up and down/left and right) so I can paint a colour over it. (See http://msdn.microsoft.com/en-us/library/ms997557.aspx#scroll32_topic2
I can get the rect of the, say, up arrow, like this:
CRect rcWnd, rcArrow;
// Get rect of whole scrollbar
GetWindowRect ( &rcWnd ); ScreenToClient ( &rcWnd );
// Get "height" of scroll button
int nHeight = GetSystemMetrics ( SM_CYVSCROLL );
rcArrow.left = 0;
rcArrow.right = rcWnd.right;
rcArrow.bottom = nHeight;
rcArrow.top = 0;
And similar methods for the horizontal scrolling.
Once I have the arrow rectangles and the thumb rectangle, I can get the rectangle of shafts above and below the thumb
Can someone help by providing a code sample please?