Jump to content

SBM SETSCROLLBAR

From EDM2

This message sets the scroll-bar range and slider position.

Syntax

param1
SHORT sslider;   /* Position of slider. */

param2
SHORT sfirst;    /* First bound. */
SHORT slast;     /* Last bound. */

Parameters

sslider (SHORT) - Input
Position of slider.
If this value is outside the scroll-bar range, the slider is moved to the nearest valid position within the range.
sfirst (SHORT) - Input
First bound.
This value must not be less than 0. If a value less than 0 is supplied, 0 is used as the value.
slast (SHORT) - Input
Last bound.
The value must not be less than 0 or sfirst. If a value less than this is supplied, the higher of 0 or sfirst is used as the value.

Returns

rc (BOOL) - returns
Success indicator.
TRUE: Successful completion
FALSE: Error occurred.

Remarks

The scroll bar control window procedure responds to this message by setting the values of the information range and the position of the slider.

The scroll bar is redrawn to reflect the change.

For example, if a scroll-bar is to allow scrolling through 100 lines of text, of which 50 are visible at any one time, and the top display line is currently number 25, sfirst should be set to 1, slast to 51 (since there are only 51 positions at which the slider may be placed), and sslider to 25. The SBM_SETTHUMBSIZE message should be used in this example to set the slider size to 50 visible parts out of 100.