static int SetScrollPosition(Handle Window,
                             int Bar,
                             int Position,
                             bool Redraw)

This function sets the position of the slider in a scroll bar.


Handle Window

The handle of the scroll bar or a handle of a __stdcall window that contains a scroll bar. The interpretation placed upon this parameter depends upon the value specified for the next parameter.

int Bar

ScrollbarIdentity::Horizontal Identifies a __stdcall horizontal scroll bar associated with a __stdcall window. The parameter Window is a handle of the __stdcall window.
ScrollbarIdentity::Vertical Identifies a __stdcall vertical scroll bar associated with a __stdcall window. The parameter Window is a handle of the __stdcall Window.
ScrollbarIdentity::Control Identifies a scroll bar whose handle is explicitly specified. The parameter Window is a handle of the scroll bar control.

int Position

The new position of the slider.

bool Redraw

true The scroll bar is redrawn.
false The scroll bar is not redrawn.



The previous position of the slider.


The specified slider position must be within the scrolling range.

This function and the functions

all support 32 bit positioning of the slider; whereas, the messages Message::HorizontalScroll and Message::VerticalScroll support only 16 bit positioning of the slider. These functions may be used to support 32 bit positions during the processing of the scroll bar messages; however, applications that require visual updates during tracking (notification ScrollbarNotify::SliderTrack) may only support 16 bit values for the slider position.


Name Space IPlusPlus::Windows
Class Win
Assembly IPlusPlus.WinPlus.dll