Jump to content

Controlclick on Zbutton?

Recommended Posts

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


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 ...


Edited by Tick
Link to post
Share on other sites
20 hours ago, Earthshine said:

Control click will never work on the lock screen



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 by Tick
Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...