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

    • Yirrlaar
      By Yirrlaar
      #Include <WinAPI.au3> local $ClassName = _WinAPI_GetClassName(WinGetHandle(WinGetTitle("[ACTIVE]"))) ControlClick(WinGetTitle("[ACTIVE]"), "", "[CLASS:"&$ClassName&"; INSTANCE:1]", "primary") When I am running this script it just gives me a ConsoleWrite output of "0x001D04A8"
      When using "AutoIT v3 Window Info" all the info I need for the ControlClick is there and displayed perfectly as if I typed it in normally.
      Upon click the button it should be clicking it, I see the following inn the console window:
      If I replace the $ClassName with the actual ClassName of "WindowsForms10.BUTTON.app.0.3296db7_r14_ad1" it works just fine, any ideas???
    • c1one
      By c1one
      Something simple enough, and I am sure it's an oversight, but I have not been able to track this down. The entire script is attached, but here is the point of failure.
      Note: I am getting the "Error: subscript used on non-accessible variable" but I thought the initial line of:
      AutoItSetOption('MouseCoordMode', 0)
      Should address that issue? 
      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      ; Install updates (minimized and updating for many minutes)
      ; Updates Not Installed Screen
         ; Wait for updates to complete
      WinWait("ProSeries Update")
         ; Wait just over 9 minutes to ensure popup is ready (test alternative to WinWait)
      Sleep(550000)
         ; Set focus on Product Licenses window
      WinActivate("ProSeries Update")
         ; Send Mouse Click to Install Now button
      MouseClick ( "left" [, 581, 362 [, clicks = 1 [, speed = 10]]] )
      ; end Installing Updates screen
      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       
      Thanks for any insights!
      c1one
      ProSeries2017_No_Customer_Info.au3
    • Tats
      By Tats
      Hi everyone,
      I have a problem with ControlClick function. It doesn't work no matter how I tried all the possible combination of the parameters.
      Below is the scripts of possible parameter combination:
      ;ControlClick("title","text","controlID ","button","clicks","x","y") ;title= Title, Class, Handle ;controlID= Class, ClassNN, Instance ;Title here is empty when I check it with AutoIt Info ControlClick("", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("", "", "[INSTANCE:18]", "left", "1", "230","890") ;Title here is the Class of the window ControlClick("[ScreenKeyboard::SKFrame]", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("[ScreenKeyboard::SKFrame]", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("[ScreenKeyboard::SKFrame]", "", "[INSTANCE:18]", "left", "1", "230","890") ;Title here is the Handle of the window ControlClick("[0x000907A0]", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("[0x000907A0]", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("[0x000907A0]", "", "[INSTANCE:18]", "left", "1", "230","890") Am I coding it correctly?
      Thanks
    • 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
       
×