WM_VSCROLL
nScrlCode = (int) LOWORD(wParam); /* scroll bar value */
nPos = (int) HIWORD(wParam); /* scroll box position */
hwndScrollBar = (HWND) lParam; /* handle of scroll bar control */
The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll-bar control when a scroll event occurs in the control.
nScrlCode
Value of the low-order word of wParam. Specifies a scroll-bar value 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 upper left. |
nPos
Value of the high-order word of wParam. Specifies the current position of the scroll box if the nScrlCode parameter is SB_THUMBPOSITION or SB_THUMBTRACK; otherwise, the nPos parameter is not used.
hwndScrollBar
Value of lParam. Identifies the control if WM_VSCROLL is sent by a scroll bar control. If WM_VSCROLL is sent by a window's standard scroll bar, the hwndScrollBar parameter is not used.
An application should return zero if it processes this message.
The SB_THUMBTRACK notification code is typically used by applications that provide feedback as the user drags the scroll box.
If an application scrolls the contents of the window, it must also reset the position of the scroll box by using the SetScrollPos function.
SetScrollPos, WM_HSCROLL