WM_VSCROLL
wScrollCode = wParam; /* scroll bar code */
nPos = LOWORD(lParam); /* current scroll box position */
hwndCtl = (HWND) HIWORD(lParam); /* handle of the control */
The WM_VSCROLL message is sent to a window when the user clicks the window's vertical scroll bar.
wScrollCode
Value of wParam. Specifies a scroll bar code that indicates the user's scrolling request. This parameter can be one of the following values:
Value | Description |
SB_BOTTOM | Scroll to bottom. |
SB_ENDSCROLL | End scroll. |
SB_LINEDOWN | Scroll one line down. |
SB_LINEUP | Scroll one line up. |
SB_PAGEDOWN | Scroll one page down. |
SB_PAGEUP | Scroll one page up. |
SB_THUMBPOSITION | Scroll to absolute position. The current position is specified by the nPos parameter. |
SB_THUMBTRACK | Drag scroll box (thumb) to specified position. The current position is specified by the nPos parameter. |
SB_TOP | Scroll to top. |
nPos
Value of the low-order word of lParam. Specifies the current position of the scroll box if wScrollCode is SB_THUMBPOSITION or SB_THUMBTRACK; otherwise, this parameter is not used.
hwndCtl
Value of the high-order word of lParam. Identifies the control if WM_VSCROLL is sent by a scroll bar. If WM_VSCROLL is sent as a result of the user clicking a pop-up window's scroll bar, the high-order word is not used.
An application should return zero if it processes this message.
The SB_THUMBTRACK message typically is used by applications that give some feedback while the scroll box is being dragged.
If an application scrolls the contents of the window, it must also reset the position of the scroll box by using the SetScrollPos function.