WM_VSCROLL Notification

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.

A window receives this message through its WindowProc function.

Syntax

WM_VSCROLL

    WPARAM wParam
    LPARAM lParam;
    

Parameters

wParam

The high-order word specifies the current position of the scroll box if the low-order word is SB_THUMBPOSITION or SB_THUMBTRACK; otherwise, this word is not used.

The low-order word specifies a scroll bar value that indicates the user's scrolling request. This parameter can be one of the following values.

SB_BOTTOM
Scrolls to the lower right.
SB_ENDSCROLL
Ends scroll.
SB_LINEDOWN
Scrolls one line down.
SB_LINEUP
Scrolls one line up.
SB_PAGEDOWN
Scrolls one page down.
SB_PAGEUP
Scrolls one page up.
SB_THUMBPOSITION
The user has dragged the scroll box (thumb) and released the mouse button. The high-order word indicates the position of the scroll box at the end of the drag operation.
SB_THUMBTRACK
The user is dragging the scroll box. This message is sent repeatedly until the user releases the mouse button. The high-order word indicates the position that the scroll box has been dragged to.
SB_TOP
Scrolls to the upper left.
lParam
If the message is sent by a scroll bar, this parameter is the handle to the scroll bar control. If the message is not sent by a scroll bar, this parameter is NULL.

Return Value

If an application processes this message, it should return zero.

Remarks

The SB_THUMBTRACK request code is typically used by applications that provide feedback as the user drags the scroll box.

If an application scrolls the content of the window, it must also reset the position of the scroll box by using the SetScrollPos function.

Note that the WM_VSCROLL message carries only 16 bits of scroll box position data. Thus, applications that rely solely on WM_VSCROLL (and WM_HSCROLL) for scroll position data have a practical maximum position value of 65,535.

However, because the SetScrollInfo, SetScrollPos, SetScrollRange, GetScrollInfo, GetScrollPos, and GetScrollRange functions support 32-bit scroll bar position data, there is a way to circumvent the 16-bit barrier of the WM_HSCROLL and WM_VSCROLL messages. See GetScrollInfo for a description of the technique.

Notification Requirements

Minimum DLL Version None
HeaderDeclared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1

See Also

Tags :


Community Content

Đonny
Value
WM_VSCROLL = &H115
Public Enum WM_HSCROLL_low As Short
SB_ENDSCROLL = 8
SB_LEFT = 6
SB_RIGHT = 7
SB_LINELEFT = 0
SB_LINERIGHT = 1
SB_PAGELEFT = 2
SB_PAGERIGHT = 3
SB_THUMBPOSITION = 4
SB_THUMBTRACK = 5
End Enum
Public Enum WM_VSCROLL_low As Short
SB_BOTTOM = 7
SB_ENDSCROLL = WM_HSCROLL_low.SB_ENDSCROLL
SB_LINEDOWN = 1
SB_LINEUP = 0
SB_PAGEDOWN = 3
SB_PAGEUP = 2
SB_THUMBPOSITION = WM_HSCROLL_low.SB_THUMBPOSITION
SB_THUMBTRACK = WM_HSCROLL_low.SB_THUMBTRACK
SB_TOP = 6
End Enum

Page view tracker