Jump to content

ControlClick Command


Ikedor
 Share

Recommended Posts

I’m trying to click the “assign a playlist” url in this application (see info.png)

I don’t know if it is flash or not.

 

The control ID changes on every launch.

I can’t use mouseclick because it needs to be scheduled at night on a server.

So just ControlClick is left as an option.

I can find the handle to the window but not to the control, be it through text or classname, clas or advanced mode.

The mouse cursor doesn't even move after these commands. 

 

$handle = WinGetHandle("[ACTIVE]")

ControlClick($handle, "", "[CLASS:TFlickerFreePaintBox.UnicodeClass; INSTANCE:1]",'left', 1, 54, 138)

ControlFocus("Q-MATIC Monitor™ 3", "", "[TFlickerFreePaintBox.UnicodeClass1]")

Controlclick("Q-MATIC Monitor™ 3", "",", "primary", 1, 54, 55)

ControlClick($handle, "", "", "Left", 1, 54, 55)

ControlClick("Q-MATIC Monitor™ 3", "", "[TEXT:Assign to playlist]")

ControlFocus ( "Q-MATIC Monitor™ 3", "", "TFlickerFreePaintBox.UnicodeClass")

 

What other parameters are possible for this?

 

info.png

flicker.png

Edited by Ikedor
Link to comment
Share on other sites

For ControlClick (and ControlSend) there's a trick:

From the AutoIt Helpfile:

ControlClick ( "title", "text", controlID [, button = "left" [, clicks = 1 [, x [, y]]]] )

 

You want the window $handle as the title (you did that already)

and in case you don't have a specific control, also the controlID part as the window $handle (you left it empty as "")

That may just fix it for you, I hope it helps :-)

Also check the coordinates you are clicking maybe. Careful about absolute vs. window coordinates etc. etc.

$hWin = WinGetHandle("Q-MATIC Monitor™ 3")
ControlClick($hWin, "", $hWin, "Left", 1, 92, 57)
Link to comment
Share on other sites

Thanks for this. Indeed that was not correct.

Alas, that didn't work.

It works with mouseclick on pos 54,183 though.

I tried to find the control on the same pos with  https://www.autoitscript.com/forum/topic/14323-_controlgethandlebypos-udf-v10/ but it refuses to get the control.

Maybe it is one of those applications where controlclick doesn't work as documented in the help chapter "controls":

Some applications write their own custom controls which may look like a standard MS control but may resist automation.  Experiment!

I'll quit trying with this and ask our operators to manually log on on the machine every weekend and execute the autoit executable using mouseclick instead.

Thanks again!

 

Link to comment
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
 Share

×
×
  • Create New...