# ControlClick Command

## 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? Edited by Ikedor #### Share this post ##### Link to post ##### 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)

##### 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!

## Create an account

Register a new account

• ### Similar Content

• Hi All,
I am trying to login into our application using AutoIT. When I launch the application a splash screen appears and the login screen goes behind it. At this point the script pauses and I loose control of everything. I have literally tried everything for the past two days but nothing has worked yet. Any suggestions would be appreciated.
RunWait("\\mchsv411.siplaceworld.net\splmshare\int00\conf\start_apps\windows\start_nx110.bat en portal_client int00 tc112", "", @SW_MAXIMIZE)
AutoItSetOption("SendKeyDelay", 200)
Local $hWnd = WinWaitActive("Teamcenter Login") MouseClick("left", @DesktopWidth / 2, @DesktopHeight / 2) The splash screen has title "Teamcenter" and is static. I tried to click on the center to get control of login window. I have tried WinActivate, WinSetState, ControlCommand and a lot of other things. • By lonardd Hi, I have a very strange problem concerning MouseClick function. I need to start Control Panel, navigate it on the Display Section (Adjust screen resolution link), click on it, and from the next Dialog choose Intel Graphic tool tab and navigate into it when it opens. I wasn't using MouseClick() at first when I tried to use Control IDs, but I was fed up with the Autoit Window Info poor and inaccurate info (It flickers and the moment I click on the control the control ID and class disappear) so I ended up choosing the easiest way. The code I'm posting worked OK until two weeks ago, the mouse clicks were accurately performed and the Script reached the end with no errors...and I was happy. All of a sudden, between one try and the other, I noticed the cursor not flying exactly where it was supposed to, namely to the Control Panel ->Display->Adjust screen resolution link but it clicked some 30 pixels below and some 30 pixels to the left, choosing obviously and undesired function and from that point it screwed the whole thing up. And from that moment onward, it seems I can no longer regain the mouse to click on that sequence. Could it be because my Control Panel ->Display form moved slightly from one test to another and therefore I got that small offside? If you believe this is the reason, I should then re position the Control Panel ->Display window to 0,0 and recalculate all the clicks. do you have a suggestion? Thanks a lot Dave RotateDisplays.au3 • #include <Constants.au3> Func Install() ConsoleWrite("Install EasyLog" & @LF) Local$handle = WinWaitActive("EasyLog USB Device Driver Installer")    ConsoleWrite("Install EasyLog2 " & $handle & @LF) Local$blah = ControlClick($handle, "", "[CLASS:Button; INSTANCE:1]", "Left", 1) ConsoleWrite("Install EasyLog3 " &$blah & @LF)    WinClose($handle) EndFunc Install() ConsoleWrite("End of Install!" & @LF) Trying to get AutoIt to click "Install" on the EasyLogUSB Device Driver Installer window. Console displays: Install EasyLog Install EasyLog2 0x001B041E Install EasyLog3 1 End of Install! Windows Info confirms the Handle is 0x001B041E Window Info for the Control For the life of me I cannot figure out why the script is not working. Even$blah says the ControlClick succeeded.
I've tried Send("{ENTER}") and MouseClick() those didn't work either.
Any help would be appreciated.
Thanks.
• By AutoPM
#RequireAdmin AutoItSetOption('MouseCoordMode', 0) If WinExists("newtitle") Then ControlClick('newtitle', '', 'Button1') EndIf a Simple script to click Button on GUI with title "newtitle". this script is working fine on my laptop on [windows 10, windows 7]
but on a different laptop. script is not clicking this button, is there any alternative to control click then please tell. don't want to use mouseclick

Thank you

• Afternoon!
This is my first post, so I apologize if this is in the wrong place.
I've created a while loop to click in a certain area of an application, and have the y axis change at the end of each loop. My loop continues to click at x:27, x:10, even though the $y is adding 15 at the end of each loop. I did a Send($x) and Send($y) into a Notepad to see if the$y had changed after each loop, and the 15 was being added to $y each loop. (If this makes sense) I'm unsure where I'm going wrong, and would be extremely grateful if someone can point me in the correct direction to fix this. Local$rDirectory = "H:\oDemandProject\fList.txt" Local $rLine = _FileCountLines($rDirectory) Local $x = 27 Local$y = 10 While $rline > 0 WinActivate("OnDemand", "-> 1") WinWaitActive("OnDemand", "-> 1") ControlClick("OnDemand", "", "[CLASS:AfxFrameOrView120u; INSTANCE:1]", "left", 4,$x, $y)$y += 15 \$rLine -= 1 WEnd
×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...