Jump to content

ControlClick seems not to work with certain elemtents

Recommended Posts

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 control.png.72dc1c0aceea9bfc92cd7c45d4cf6570.png. 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 :(


Link to post
Share on other sites

Earthshine: The picture of code is just to give you idea of what I am doing: test-clicking in a row to see where the clicks register. Having this in copy-able format doesnt help anybody, as I dont think anyone have the program in question.

Link to post
Share on other sites

It doesn’t matter.  We are here to help you improve it and there are those here who will just hand over code so you should show something besides a pic. Also you have no logging so you have no idea what’s going on

My resources are limited. You must ask the right questions


Link to post
Share on other sites

I have no idea how to approach you at this point, and I got the feeling you either not read my post, or misunderstood the issue compleately.

My code is really just one line of code, that will not work anywhere else besides my PC, as explained before. Noone can test it, run it or do anything with it, whether I post a pic or code, and its not even desired to be able so. I will not distribute the program this script interact with, so there is not a single point of initiative for others to play with the code. I only posted to pic to give a general idea of what I am doing (that is, sending control click and example parameters, activating the window beforehand and showing a loop I am using to send this single line of code multipletimes), and provided a verification that its working in a certain part of a program, so there is no dispute about whether the line is good as is. 

I still dont see how sharing a single line of code could help anyone solve this, as they would still be missing the end program to test it with. 

The main concern of mine is if someone encountered similar issue, possibly with an idea of working with such unresponsive elements, they could share their insights.


So far your tip and following paragraph are unhelpfull and needless, so if you have no intention of actually helping solve the original issue, I am gonna ask you to please refrain from any more comments regarding the issue you found (and tried to validate) with my post.


Edited by MaximusCZ
Link to post
Share on other sites

The coordinates in your ControlClick, are they the control coordinates, or the window coordinates? The ControlClick coordinates are the position inside the control bounds, so if you're using window coordinates, you're clicking in the wrong place.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to post
Share on other sites

well, I did some research on the control, and the good news is, that products like WinTask can use it through UI Automoation. FAQ 31 has a link for the IUIAutomation kit should all else fail. It has a SimpleSpy application that can find all the UI elements and their properties too.

When I first saw your post, I thought, oh boy, some old ActiveX OCX. I know from personal experience with them that they can be problematic when trying to interact with in standard AutoIT.

Anyway, good luck.

I just wanted to add that I needed the IUIAutomation kit for the old OCXs and applications if I was to do anything in AutoIT, even in one case it was just to get it to focus on the control so I can send key commands to it (that's how locked down they can be)

Edited by Earthshine

My resources are limited. You must ask the right questions


Link to post
Share on other sites

And, looking into WinTask, that looks like an amazing wrapper for UIAutomation using a VB syntax and a script generator/recorder. $299 for two years support, but it might be well worth it. I know i could whip up all the regression scripts for our products fast with it, and, if it worked with our old VB6 apps and controls, it would rule. this research lead me to that product. It can easily handle any WPF or WinForms, I am going to get the free trial to see if I can automate that horrid vb6 ocx.

Edited by Earthshine

My resources are limited. You must ask the right questions


Link to post
Share on other sites

so, i got WinTask free 30 day trial and already have whipped up a fair flame test. who knew it could be this easy. it's super fast and handles Winforms, WPF and VB6 and EVEN JAVA apps. Who knew? Buying it. Handles browsers too.

Edited by Earthshine

My resources are limited. You must ask the right questions


Link to post
Share on other sites
  • 6 months later...
  • 4 weeks later...
On 11/21/2018 at 3:10 PM, tentacole said:

I'm currently having this same problem. Did you ever find a fix to this issue?

Sadly, no. I still havent managed to click that button without my mouse actually pointing it it.

Funnily enough, I dived into WM_events and sent the window events regarding mouse movements, which worked for most of unresponsive UI, but this part is still out of my reach

Link to post
Share on other sites
On 12/18/2018 at 10:40 AM, MaximusCZ said:

Sadly, no. I still havent managed to click that button without my mouse actually pointing it it.

Funnily enough, I dived into WM_events and sent the window events regarding mouse movements, which worked for most of unresponsive UI, but this part is still out of my reach

I figured out my problem I was having.. hopefully it may help you. For your ControlClicks function, it looks like you are using the ClassNameNN - Try using the Advanced(Class) instead. The problem I was having was that I was attempting to create a loop to select between two instances within the window, but when I would click on the second instance, the second instance would turn into the first instance. 

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.

  • Similar Content

    • By basictheprogram
      #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.
    • 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
    • By tentacole
      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  
    • 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???
    • 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?
  • Create New...