Jump to content

ControlClick not working. How to properly troubleshoot?


Go to solution Solved by bogQ,

Recommended Posts

Hi all.  I'm trying to use AutoIt to click a button in a Windows screenshot program named ShareX, but am having difficulty. I've used Au3Info.exe to get information about the control (see screenshot below). After, I added the following line to a file, and executed the code.  How can I troubleshoot and resolve? 

ControlClick("ShareX - Editor menu", "", 199150)

This prints the following to the console: 

0

As a fallback, I guess I can send a mouse click to a certain XY coordinate.  But before that I'd like to understand why this isn't working. 

Thanks in advance.

Here is info about my control, as well as a screenshot of the Window in-question, and the control I want to click.  One item of note is that the ID value is not contant--it changes every time the window is opened.  But the Title and Class values remain constant.

image.thumb.png.628e48e7a0d96b9aa038fed27799612f.png

Link to comment
Share on other sites

OK thanks very much for the help.  Progress was made, if at least by my failures 🙂  

  • I tried your code.
    • There was no change in result.  The control was still unclicked and the function returned 0.
    • But, I noticed that you have an extra `1` at the end of the string in your final parameter:  you have `ad111` instead of `ad11`
  • I tried your code, with the extraneous `1` removed.
    • There was a slight change in result.  The control was still unclicked, but the function returned 1 instead of 0.
  • I tried your code, with two `1`s removed (to match the value for Class instead of Class์ameNN.
    • There was no change in result.  The control was still unclicked and the function returned 0.
  • I tried changing the final parameter to: 'ShareX - Editor menu' 
    • There was no change in result.  The control was still unclicked and the function returned 0.

 

Thoughts?  If I recall, AutoIt doesn't promise to always be able to send a click to a control.  Is this one of those cases?

 

Link to comment
Share on other sites

  • Solution

(Size: w=1708, h=32) = your control is a entire toolbar and not a single button or similar control.

in autoit window info tool go under "Options" to enable "Highlight Controls" for more help. just calling ControlClick will do click to the middle of a control, try using optional ControlClick parameters for that control regarding X,Y click position (use ControlClick Coords from window info tool), other way to try is mouseclick

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

OK bingo that was it--good eye, and thanks!

 

FYI I specified the coordinates of the control when calling ControlClick, and that worked for me.

Edited by cag8f
Link to comment
Share on other sites

  • Developers

Ok, I will unlock that last topic and cleanup the last couple of posts in this thread in a couple of minutes to clean things up, but please don't go crazy with creating topics. ;) 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...