Eddie987 Posted June 19, 2023 Share Posted June 19, 2023 Hi I use the method below to make a click inside a specific window called "TEST" on a "activate" button WinActivate("TEST") ControlClick("TEST", "", "", "left", 1, 109, 170) How to I make a mouse slide movement inside the same window to example move a slider to a specific position? MouseClickDrag ( "button", x1, y1, x2, y2) Does not seem to work because the x and y positions are relative to the PC screen and not the window coordinates The window is not always in same position on the screen, also ControlClick leaves my mouse free to use while the script run Link to comment Share on other sites More sharing options...
ahmet Posted June 19, 2023 Share Posted June 19, 2023 Look for MouseCoordMode under AutoItSetOption. Eddie987 1 Link to comment Share on other sites More sharing options...
Eddie987 Posted June 19, 2023 Author Share Posted June 19, 2023 1 hour ago, ahmet said: Look for MouseCoordMode under AutoItSetOption. Thank you, i will test the "MouseCoordMode" Is there a way to use it so the mouse does not physically move (like controlclick does) Link to comment Share on other sites More sharing options...
ahmet Posted June 19, 2023 Share Posted June 19, 2023 No, but if you want to interact with a slider from a gui that you have not made look for _GUICtrlSlider... functions. Eddie987 1 Link to comment Share on other sites More sharing options...
ioa747 Posted June 19, 2023 Share Posted June 19, 2023 expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> HotKeySet("{END}", "_Test1") ; <---------- {END} TestGUI() Func TestGUI() GUICreate("TEST", 220, 100, 100, 200) GUISetBkColor(0x00E0FFFF) ; will change background color Local $idSlider1 = GUICtrlCreateSlider(10, 10, 200, 20) GUICtrlSetLimit(-1, 200, 0) ; change min/max value Local $idButton = GUICtrlCreateButton("Value?", 75, 70, 70, 20) GUISetState(@SW_SHOW) GUICtrlSetData($idSlider1, 40) ; set cursor Local $idMsg ; Loop until the user exits. While 1 $idMsg = GUIGetMsg() Switch $idMsg Case $GUI_EVENT_CLOSE ExitLoop Case $idButton ConsoleWrite("- slider1=" & GUICtrlRead($idSlider1) & @CRLF) EndSwitch WEnd EndFunc ;==>TestGUI ;---------------------------------------------------------------------------------------- Func _Test1() Local $hWnd = WinWait("TEST") WinActivate($hWnd) ControlClick($hWnd, "", "msctls_trackbar321", "left", 1, 10, 7) ControlClick($hWnd, "", "Button1") EndFunc ;==>_Test1 ;---------------------------------------------------------------------------------------- Eddie987 1 I know that I know nothing Link to comment Share on other sites More sharing options...
Eddie987 Posted June 19, 2023 Author Share Posted June 19, 2023 1 minute ago, ioa747 said: expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> HotKeySet("{END}", "_Test1") ; <---------- {END} TestGUI() Func TestGUI() GUICreate("TEST", 220, 100, 100, 200) GUISetBkColor(0x00E0FFFF) ; will change background color Local $idSlider1 = GUICtrlCreateSlider(10, 10, 200, 20) GUICtrlSetLimit(-1, 200, 0) ; change min/max value Local $idButton = GUICtrlCreateButton("Value?", 75, 70, 70, 20) GUISetState(@SW_SHOW) GUICtrlSetData($idSlider1, 40) ; set cursor Local $idMsg ; Loop until the user exits. While 1 $idMsg = GUIGetMsg() Switch $idMsg Case $GUI_EVENT_CLOSE ExitLoop Case $idButton ConsoleWrite("- slider1=" & GUICtrlRead($idSlider1) & @CRLF) EndSwitch WEnd EndFunc ;==>TestGUI ;---------------------------------------------------------------------------------------- Func _Test1() Local $hWnd = WinWait("TEST") WinActivate($hWnd) ControlClick($hWnd, "", "msctls_trackbar321", "left", 1, 10, 7) ControlClick($hWnd, "", "Button1") EndFunc ;==>_Test1 ;---------------------------------------------------------------------------------------- Thank you Link to comment Share on other sites More sharing options...
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