SLM SETSLIDERINFO
This message sets the current position or dimensions of a key component of the slider. The component to be changed is indicated by one parameter, and the new value is placed in the other.
Syntax
param1 USHORT usInfoType; /* Component attribute. */ USHORT usArmPosType; /* Format attribute. */ param2 ULONG ulInfo; /* New value. */
Parameters
- usInfoType (USHORT) - Input
- Identifies the slider component that is to be modified. Specify one of the following:
- SMA_SHAFTDIMENSIONS: Sets the width (for vertical sliders) or height (for horizontal sliders) of the slider shaft.
- SMA_SHAFTPOSITION: Sets the x-, y-position of the lower-left corner of the slider shaft in the slider window.
- SMA_SLIDERARMDIMENSIONS: Sets the width and height of the slider arm.
- SMA_SLIDERARMPOSITION: Sets the position of the slider arm. This value can be specified either as an increment position or a range value.
- usArmPosType (USHORT) - Input
- Identifies the format in which the information should be interpreted by the slider if setting the slider arm position is requested. This value is a reserved field for other set requests. The format is one of the following:
- SMA_RANGEVALUE: Number of pixels between the home position and the current arm position.
- SMA_INCREMENTVALUE: Increment position using the primary scale.
- ulInfo (ULONG) - Input
- New value to change the slider component to. The format of the information depends on the component being changed and is indicated by the SMA_* message attribute or attributes that are set.
- If the SMA_SHAFTDIMENSIONS attribute is set, the ulInfo parameter is as follows:
- usShaftBreadth (USHORT): Width (for vertical sliders) or height (for horizontal sliders) the slider shaft should be set to, in pixels. This is the breadth the shaft should be.
- If the SMA_SHAFTPOSITION attribute is set, the ulInfo parameter is as follows:
- xShaftCoord (USHORT): X-coordinate to set the position of the shaft to within the slider window. This value is expressed in window coordinates and represents the lower-left corner of the shaft.
- yShaftCoord (USHORT): Y-coordinate to set the position of the shaft to within the slider window. This value is expressed in window coordinates and represents the lower-left corner of the shaft.
- If the SMA_SLIDERARMDIMENSIONS attribute is set, the ulInfo parameter is as follows:
- usArmLength (USHORT): Length of the slider arm, in pixels. This is the width of the arm for horizontal sliders and the height of the arm for vertical sliders.
- usArmBreadth (USHORT): Breadth of the slider arm, in pixels. This is the height of the arm for horizontal sliders and the width of the arm for vertical sliders.
- If the SMA_SLIDERARMPOSITION and SMA_RANGEVALUE attributes are set, the ulInfo parameter is as follows:
- usArmPos (USHORT): Number of pixels to be set from home to the slider arm.
- If the SMA_SLIDERARMPOSITION and SMA_INCREMENTVALUE attributes are set, the ulInfo parameter is as follows:
- usIncrementPos (USHORT): Increment value which corresponds to the position the slider arm should be set to.
Returns
- rc (BOOL) - returns
- Success indicator.
- TRUE: Slider component was successfully set.
- FALSE: An error occurred. The WinGetLastError function may return the following errors:
- PMERR_INVALID_PARAMETERS
- PMERR_PARAMETER_OUT_OF_RANGE.
Remarks
The application uses this message to customize the slider for a specific use. In setting the shaft dimensions, only the breadth of the slider can be set. The length of the shaft is always determined by the number of increments and the spacing between increments, both of which are set for the primary scale when the slider is created.
Positioning of the shaft within the slider window could be used by applications that cannot use the default positioning provided by the slider control.
Setting of the slider arm dimensions could be used by applications that need a larger slider arm, such as touch screen applications.
Setting the slider arm position can be used to:
- Set the initial value of the slider before it becomes visible.
- Change the value when it is tied to another control, such as an entry field.
- Show the value of a quantity when the slider is being used to monitor an event, such as a read-only slider being used as a progress indicator.
Default Processing
The default window procedure does not expect to receive this message and therefore takes no action on it other than to return FALSE.