mpreis Posted July 2, 2024 Posted July 2, 2024 Hi Community, I have written many small scripts so far which are all used to control a 3rd party software - I would say that I am an average experienced user. Now I have got the situation that I am not able to start a job (i.e. click on a button of a form) in any way. Usually it should work using the lines below - but as described it doesn't. WinWait("Spezielle Installation", "") Sleep(1000) ControlFocus("Spezielle Installation", "", "[CLASS:Button; INSTANCE:2]") ControlClick("Spezielle Installation", "", "[CLASS:Button; INSTANCE:2]") The form itself is rather simple: Window Info lists the following things: All I want to do is to click the button with the text "Erstellen". I also tried to move the mouse to the button and send a click: AutoItSetOption("MouseCoordMode", 1) MouseMove(Number($X), Number($Y), 20) WinActivate("Spezielle Installation", "") MouseClick("left") I noticed that even moving the mouse does not work when i activate the window before moving the mouse ... it seems as if there is a kind of protection. Does anyone have any advise on that?
ioa747 Posted July 2, 2024 Posted July 2, 2024 (edited) That's how I would try it Local $hWnd = WinWait("[CLASS:#32770; TITLE:Spezielle Installation]", "", 10) If WinExists($hWnd) Then WinActivate($hWnd) ConsoleWrite("$hWnd=" & $hWnd & @CRLF) Local $hCtrl = ControlGetHandle ($hWnd, "", "Button2") ConsoleWrite("$hCtrl=" & $hCtrl & @CRLF) Local $iMsg = ControlClick ($hWnd, "", $hCtrl) ConsoleWrite("$iMsg=" & $iMsg & @CRLF) Else ConsoleWrite("! $hWnd NOT Exist" & @CRLF) EndIf so that through ConsoleWrite I can understand where it is failing Edited July 2, 2024 by ioa747 I know that I know nothing
mpreis Posted July 2, 2024 Author Posted July 2, 2024 2 hours ago, ioa747 said: That's how I would try it Local $hWnd = WinWait("[CLASS:#32770; TITLE:Spezielle Installation]", "", 10) If WinExists($hWnd) Then WinActivate($hWnd) ConsoleWrite("$hWnd=" & $hWnd & @CRLF) Local $hCtrl = ControlGetHandle ($hWnd, "", "Button2") ConsoleWrite("$hCtrl=" & $hCtrl & @CRLF) Local $iMsg = ControlClick ($hWnd, "", $hCtrl) ConsoleWrite("$iMsg=" & $iMsg & @CRLF) Else ConsoleWrite("! $hWnd NOT Exist" & @CRLF) EndIf so that through ConsoleWrite I can understand where it is failing this is the outcome: $hWnd=0x000D0702 $hCtrl=0x0007072A $iMsg=1
ioa747 Posted July 2, 2024 Posted July 2, 2024 (edited) here it shows that all is well Try with https://www.autoitscript.com/forum/files/file/478-control-viewer-mod maybe the ctrl overlaps with another one or with #RequireAdmin * <-- (most of the times) Edited July 3, 2024 by ioa747 I know that I know nothing
mpreis Posted July 2, 2024 Author Posted July 2, 2024 I see - but the app process does not start ... it's just working when you physically click the button with the mouse.
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