Retrieving Data for Selected Slider Values

To retrieve data represented by a slider value, specify a variable for the current position of the slider arm. Then, use the SLM_QUERYSLIDERINFO message to retrieve information about the current slider arm position in increment coordinates. The code fragment in the following figure shows how to retrieve data for a selected slider value:

ULONG  ulValue;                     /* Variable in which to store     */
                                    /* current slider arm position    */

/**********************************************************************/
/* Get the information about the current slider arm position in       */
/* incremental coordinates.                                           */
/**********************************************************************/
ulValue = (ULONG)WinSendMsg(
  hwndSlider,                       /* Slider window handle           */
  SLM_QUERYSLIDERINFO,              /* Message for querying slider    */
                                    /* attributes                     */
  MPFROM2SHORT(
    SMA_SLIDERARMPOSITION,          /* Get increment at which slider  */
    SMA_INCREMENTVALUE),            /* arm is located                 */
  NULL);                            /* Reserved value                 */


[Back: Creating a Linear Slider]
[Next: Creating a Circular Slider]