mpreis Posted Tuesday at 09:25 AM Share Posted Tuesday at 09:25 AM 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? Link to comment Share on other sites More sharing options...
ioa747 Posted Tuesday at 09:58 AM Share Posted Tuesday at 09:58 AM (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 Tuesday at 10:08 AM by ioa747 I know that I know nothing Link to comment Share on other sites More sharing options...
mpreis Posted Tuesday at 12:39 PM Author Share Posted Tuesday at 12:39 PM 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 Link to comment Share on other sites More sharing options...
ioa747 Posted Tuesday at 12:54 PM Share Posted Tuesday at 12:54 PM (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 yesterday at 04:05 AM by ioa747 I know that I know nothing Link to comment Share on other sites More sharing options...
mpreis Posted Tuesday at 12:57 PM Author Share Posted Tuesday at 12:57 PM I see - but the app process does not start ... it's just working when you physically click the button with the mouse. 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