Tick Posted April 23, 2021 Share Posted April 23, 2021 (edited) There are several zbutton buttons on the window of the application I am trying to control. Some of them I can easily click with a controlclick command, and some do not respond, but no error is returned. At the same time, the mouseclick command works with it. Opt("WinSearchChildren", 1) Opt("WinTitleMatchMode", 2) $hWnd=WinGetHandle ("Order Ticket") ControlClick($hWnd,"","[CLASS:ZButton; INSTANCE:13]");working ControlClick($hWnd,"","[CLASS:ZButton; INSTANCE:22]"); not working MouseClick("left",617,742);working Are there any other ways to hit the button? How can I press the desired button even if the window is resized? I am trying to use controlclick to make the script work even on a locked screen ... Thanks.. Edited April 24, 2021 by Tick Link to comment Share on other sites More sharing options...
Earthshine Posted April 24, 2021 Share Posted April 24, 2021 Control click will never work on the lock screen Tick 1 My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
InnI Posted April 24, 2021 Share Posted April 24, 2021 On 4/23/2021 at 10:46 AM, Tick said: Are there any other ways to hit the button? ControlSend($hWnd, "", "ZButton22", "{space}") ; or ControlCommand($hWnd, "", "ZButton22", "SendCommandID", 0xF5) ; $BM_CLICK Tick 1 Link to comment Share on other sites More sharing options...
Tick Posted April 24, 2021 Author Share Posted April 24, 2021 (edited) 20 hours ago, Earthshine said: Control click will never work on the lock screen https://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3F Quote So generally don't use Send() MouseClick() WinActivate() WinWaitActive() WinActive() etc. Instead use ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() etc. Doing so allows you to interact with an application regardless of whether it is active or not. It's possible to run such a script from scheduler on locked Windows stations. With some difficulty I got my script to work even the screen is locked. Now I am trying to expand the functionality. The controlclick command succeeds even if the screen is locked, but exceptions are thrown in some cases. Edited April 24, 2021 by Tick 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