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 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 scroll, such as scroll up one line, scroll down a page, or scroll to the bottom. The type of scroll is determined by which area of the scroll bar the user clicks.
The user can also make a scrolling request by using the scroll-bar thumb, the small rectangle inside the scroll bar. The user moves the thumb by moving the mouse while holding the left mouse button down when the cursor is in the thumb. 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 thumb. Each message specifies the current position of the thumb.