楼主的意思是把一个带有滑动条的窗口上的滑动条进行调节是吧?
我先模拟一个带有滑动条的窗口
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=www.ico
#AutoIt3Wrapper_Outfile=滑动条1.exe
#AutoIt3Wrapper_UseX64=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate('滑动条测试', 514, 97, -1, -1)
$Slider1 = GUICtrlCreateSlider(24, 16, 473, 17)
$Slider2 = GUICtrlCreateSlider(24, 40, 473, 17)
$Slider3 = GUICtrlCreateSlider(24, 64, 473, 17)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
然后写一个调节滑动条的代码:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=www.ico
#AutoIt3Wrapper_Outfile=设置滑动条.exe
#AutoIt3Wrapper_UseX64=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GuiSlider.au3>
Run('滑动条1.exe')
While 1
If WinExists('滑动条测试','') Then ExitLoop
WEnd
WinActivate('滑动条测试', '')
Local $HD = WinGetHandle('滑动条测试', '')
Local $HD1 = ControlGetHandle($HD, '', 'msctls_trackbar321')
Local $HD2 = ControlGetHandle($HD, '', 'msctls_trackbar322')
Local $HD3 = ControlGetHandle($HD, '', 'msctls_trackbar323')
_GUICtrlSlider_SetPos($HD1, 20)
Sleep(2000)
_GUICtrlSlider_SetPos($HD2, 55)
Sleep(2000)
_GUICtrlSlider_SetPos($HD3, 80)
Sleep(2000)
WinClose($HD)
Exit
|