Scrolling Text with the WM_SIZE Message
When processing the WM_SIZE message, it is convenient to adjust the scrolling range and scrolling position to reflect the dimensions of the client area as well as the number of lines of text that will be displayed.
The SetScrollInfo function sets the minimum and maximum position values, the page size, and the scrolling position for a scroll bar. For versions earlier than 4.0, use the SetScrollRange function to set the minimum and maximum position values, and the SetScrollPos function to adjust the scroll box to reflect the scrolling position.