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:

control2.png.5f29d3eb79673738631a343fcf0e1586.png

I am testing its interaction with code

control3.png.d1656008ed10121452dd2350bb0fd0ad.png

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 comment
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 comment
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 comment
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 comment
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 comment
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 comment
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 comment
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 comment
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 comment
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 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...