Jump to content
Ikedor

ControlClick Command

Recommended Posts

Ikedor

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

Share this post


Link to post
Share on other sites
guestscripter

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)

Share this post


Link to post
Share on other sites
Ikedor

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!

 

Share this post


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

  • Similar Content

    • MaximusCZ
      By MaximusCZ
      Hello, and apologies if this have been discussed before, but I googled and couldnt find anything relevant.
      I have a problem where I try to send a control clink into to a window. 
      Part of window I try to send clicks to looks like this . The black border is showing when I mouse over it Au3Info, I get following information:

      I am testing its interaction with code

      The result I get is that it makes control clicks trough first line, opens and closes menus, as expected.
      When It gets to second line, it does not click a single icon. I can tell that coords are correct as the dropdown menus (No view active) gets focused(altough not rolled out). Same behaviour happens if roughly 40<y<60, so I know I am hitting good height. You can look at how it behaves here: output.webm 
      Dropdown 1 focuses at around 8 sec mark, and 13 sec mark it changes to second dropdown, defocusing first one, seemingly not registering any clinks inbetween.
       
      Have you ever encountered similar behaviour? I need to click the Key button, first on second line, with controlclick (or any other way not hijacking the mouse). I cant trigger that button by keyboard and There is no other control having control over it.
      Help
       
    • Skysnake
      By Skysnake
      I need to automate a specific GUI from a legacy system written in C.
      The spy tool gives me this

      I use this code
      Local $swintit = WinGetTitle("[active]") ConsoleWrite("active Window " & $swintit & @CRLF) If $swintit = "FILES NOTES" Then ; If $swintit = "FILES NOTES" Then ; got Window, now atomate ConsoleWrite("got Window " & @CRLF) ; now focus, then click :) ;EditPaste ;ControlCommand("FILES NOTES", "", 404, $acno) ; paste acno GUICtrlSetState(404, $GUI_Focus) ControlCommand("FILES NOTES", "", 404, $acno) ; paste acno GUICtrlSetState(401, $GUI_Focus) ControlClick("FILES NOTES", "", 401, $acno) ; click okay EndIf ; If $swintit = "FILES NOTES" Then The idea is to paste the acno value into the edit box, then click an Okay button.
      I get a console write that the active Window is as expected, but my loop completes without ever writing anything into the GUI.
      I also tried the control ID as text "404" - same result
      What am I missing?
      Skysnake
       
    • JNutt
      By JNutt
       

       
       
      I'm trying to use mouseclick in a panel above.  I want to click on a list item, such as 'Estimated'.  (I've given up on trying to use control click for this).  I'm using window info coordinates from 'Control' tab.

      ; click 'Columns' WinActivate("Innovaya Studio with Sage (Archtectural 2017_V1.invx") MouseClick("primary", 292, 88, 1, 1) WinActivate("Select Browsing Properties") Sleep(1000) MouseClick("primary", 27, 70, 0,0) Sleep(2000) Send("{TAB}{TAB}{TAB}{TAB}{TAB}") Sleep(1000) Send("{ENTER}") ControlClick( But when I used the code Autoit doesn't click where the coordinates are.  In the scipts it is the second MouseClick that won't work.  Any ideas?
    • dadalt
      By dadalt
      Hi!
      I have a button where I need to close it!
      I was doing through  clicking same position in screen but there are some id's that have different sizes.
      What are the possible ways to click this closable button?
      Is there a way to close it through id? Is there a way to get it's position through it's ID?  
      Thanks in advance!


    • Miliardsto
      By Miliardsto
      Hello I got this script works below and I want to do not move cursor on screen when action is performed.
      Opt("MouseCoordMode", 1) ; cause it gets whole screen coords Local $x, $y Local $search = _ImageSearch('item.bmp', 0, $x, $y, 0) If $search = 1 Then MouseMove($x, $y,0) MouseClick("right", $x, $y)) MouseMove($xMiddle, $yMiddle,0) MouseClick("left", $xMiddle, $yMiddle) EndIf I changed this above to this below and what happen is. It clicks right button and then left button but not move mouse to $x $y and then to $xMiddle $yMiddle.
      Opt("MouseCoordMode", 1) ; cause it gets whole screen coords Local $x, $y Local $search = _ImageSearch('item.bmp', 0, $x, $y, 0) If $search = 1 Then ControlClick("","",0,"secondary",1,$x,$y) ControlClick("","",0,"primary",1,$xMiddle,$yMiddle) EndIf If needed I got handle in var $hwnd
      Please tell me how parameters in ControlClick would like be
×