Jump to content
Sign in to follow this  

Get Slider Position for non-MS Sliders

Recommended Posts


I'm trying to get and set slider positions in a program that uses "Slider20WndClass" sliders, not the "msctls_trackbar32" that I understand _GUICtrlSliderGetPos was written for. The only information I could find on getting and setting slider positions in non-AutoIt GUIs suggested using _GUICtrlSliderGetPos. Here's the code I have currently:

#include <GUIConstants.au3>
#include <Misc.au3>
#Include <GuiSlider.au3>

Opt("WinTitleMatchMode", 2);set partial match mode for window titles
$h_slider=ControlGetHandle("Calibration", "", "[CLASSNN:Slider20WndClass1]")

$GUI=GUICreate("Slider Setting", 200, 100)
GUICtrlCreateLabel("Slider = " & $SliderPos, 50, 20, 150, 30, $SS_LEFT)
$OKButton = GUICtrlCreateButton("OK", 70, 50, 60)
While 1
  $msg = GUIGetMsg()
  IF $msg = $OKButton Then

The slider position comes back as -1, which I assume is an error value, for all slider positions. Can anyone suggest a way to get/set the slider position for these sliders? Thanks in advance!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.