JPeters Posted October 31, 2007 Posted October 31, 2007 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 WinActivate("Calibration") $h_slider=ControlGetHandle("Calibration", "", "[CLASSNN:Slider20WndClass1]") $SliderPos=_GUICtrlSliderGetPos($h_slider) $GUI=GUICreate("Slider Setting", 200, 100) GUICtrlCreateLabel("Slider = " & $SliderPos, 50, 20, 150, 30, $SS_LEFT) $OKButton = GUICtrlCreateButton("OK", 70, 50, 60) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() IF $msg = $OKButton Then GUIDelete($GUI) ExitLoop Endif WEnd 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!
BrettF Posted October 31, 2007 Posted October 31, 2007 Maybe see what ControlGetText returns on the slider? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now