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.