SBM_SETSCROLLINFO message

The SBM_SETSCROLLINFO message is sent to set the parameters of a scroll bar.

Applications should not send this message directly. Instead, they should use the SetScrollInfo function. A window receives this message through its WindowProc function. Applications which implement a custom scroll bar control must respond to these messages for the SetScrollInfo function to function properly.

Parameters

wParam

Specifies whether the scroll bar is redrawn to reflect the new scroll box position. If this parameter is TRUE, the scroll bar is redrawn. If it is FALSE, the scroll bar is not redrawn.

lParam

Pointer to a SCROLLINFO structure. Before calling SetScrollInfo, set the cbSize member of the structure to sizeof(SCROLLINFO), set the fMask member to indicate the parameters to set, and specify the new parameter values in the appropriate members.

The fMask member can be one or more of the following values.

ValueMeaning
SIF_DISABLENOSCROLL

Disables the scroll bar instead of removing it, if the scroll bar's new parameters make the scroll bar unnecessary.

SIF_PAGE

Sets the scroll page to the value specified in the nPage member.

SIF_POS

Sets the scroll position to the value specified in the nPos member.

SIF_RANGE

Sets the scroll range to the value specified in the nMin and nMax members.

 

Return value

The return value is the current position of the scroll box.

Remarks

The messages that indicate scroll bar position, WM_HSCROLL and WM_VSCROLL, provide only 16 bits of position data. However, the SCROLLINFO structure used by SBM_GETSCROLLINFO, SBM_SETSCROLLINFO, GetScrollInfo, and SetScrollInfo provides 32 bits of scroll bar position data. You can use these messages and functions while processing either the WM_HSCROLL or WM_VSCROLL messages to obtain 32-bit scroll bar position data.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

See also

Reference
GetScrollInfo
SBM_GETSCROLLINFO
SCROLLINFO
SetScrollInfo

 

 

Community Additions

ADD
Show:
© 2014 Microsoft