SLM QUERYSLIDERINFO
Appearance
This message queries the current position or dimensions of a key component of the slider. The information returned and its format depends on the type of information requested.
Syntax
param1 USHORT usInfoType; /* Information attribute. */ USHORT usArmPosType; /* Format attribute. */ param2 ULONG ulReserved; /* Reserved value, should be 0. */
Parameters
- usInfoType (USHORT) - Input
- Attribute that identifies the requested information. It can be one of the following:
- SMA_SHAFTDIMENSIONS: Queries for the length and breadth of the slider shaft.
- SMA_SHAFTPOSITION: Queries for the x-, y-position of the lower-left corner of the slider shaft.
- SMA_SLIDERARMDIMENSIONS: Queries for the length and breadth of the slider arm.
- SMA_SLIDERARMPOSITION: Queries for the position of the slider arm. The position can be returned either as an increment position or a range value.
- usArmPosType (USHORT) - Input
- Attribute that identifies the format in which the information should be returned if the slider arm position is requested. This value is ignored for all other queries and is one of the following:
- SMA_RANGEVALUE: The value returned in the low-order word represents the number of pixels between the home position and the current arm position. The high-order word represents the pixel count of the entire range of the slider control.
- SMA_INCREMENTVALUE: The value returned represents an increment position using the primary scale.
- ulReserved (ULONG) - Input
- Reserved value, should be 0.
Returns
- ulInfo (ULONG) - returns
- Return information.
- One of the following items, depending on which SMA_* message attribute or attributes were set with the SLM_SETSLIDERINFO message:
- If the SMA_SHAFTDIMENSIONS attribute is set, the following is returned:
- usShaftLength (USHORT): Length of the slider shaft, in pixels. It is the width of the slider shaft for horizontal sliders and the height of the slider shaft for vertical sliders.
- usShaftBreadth (USHORT): Breadth of the slider shaft, in pixels. It is the height of the slider shaft for horizontal sliders and the width of the slider shaft for vertical sliders.
- If the SMA_SHAFTPOSITION attribute is set, the following is returned:
- xShaftCoord (USHORT): X-coordinate of the slider shaft position within the slider window. This value is expressed in window coordinates and represents the lower-left corner of the slider shaft.
- yShaftCoord (USHORT): Y-coordinate of the slider shaft position within the slider window. This value is expressed in window coordinates and represents the lower-left corner of the slider shaft.
- If the SMA_SLIDERARMDIMENSIONS attribute is set, the following is returned:
- usArmLength (USHORT): Length of the slider arm, in pixels. It is the width of the slider arm for horizontal sliders and the height of the slider arm for vertical sliders.
- usArmBreadth (USHORT): Breadth of the slider arm, in pixels. It is the height of the slider arm for horizontal sliders and the width of the slider arm for vertical sliders.
- If the SMA_SLIDERARMPOSITION and SMA_RANGEVALUE attributes are set, the following is returned:
- If the SMA_SLIDERARMPOSITION and SMA_INCREMENTVALUE attributes are set, the following is returned:
- usIncrementPos (USHORT): Increment that corresponds to the current position of the slider arm.
- If the SLDERR_INVALID_PARAMETERS error is returned, an error occurred. The WinGetLastError function may return the following error:
- PMERR_INVALID_PARAMETERS.
Remarks
The application uses this message to query for information about individual parts of a slider control or the value selected by a user.
Default Processing
The default window procedure does not expect to receive this message and therefore takes no action on it other than to return 0.