A user makes a scrolling request by clicking in a scroll bar. Windows sends the request to the given window in the form of WM_HSCROLL and WM_VSCROLL messages. The messages' lParam parameter contains a position value and the handle of the scroll-bar control that generated the message (lParam is zero if a standard scroll bar generated the message). The wParam parameter specifies the type of scrolling; for example, the user may scroll up one line, scroll down a page, or scroll to the bottom. The type of scrolling is determined by which area of the scroll bar the user clicks.
The user can also make a scrolling request by using the scroll box, the small
rectangle inside the scroll bar. The user moves the scroll box by moving the
mouse while holding the left mouse button down when the cursor is positioned
on the scroll box. The scroll bar sends SB_THUMBTRACK and SB_THUMBPOSITION flags with a WM_HSCROLL or WM_VSCROLL
message to an application as the user moves the scroll box. Each message specifies the current position of the scroll box.