Sign in to follow this  
Followers 0
BruceCopperField

ControlClick() Not Working?

6 posts in this topic

My appli. is a java applet in browser having a SunAwtCanvas under the Internet Explorer_Server control. I can use MouseClick() to move the mouse and give it a click at my desired position. But when I use ControlClick(), it will only click on the current position of the mouse without moving it to the specified position. Is it a nature of the SunAwtCanvas control that prevent ControlClick() or did I made any miistake?. My test code is here:

Opt("WinTitleMatchMode",2);substring
Opt("MouseCoordMode", 0) ; relative to active windows
WinActivate($title)
WinWaitActive($title)
sleep(1500)
ControlFocus ( $title, "", "[CLASSNN:SunAwtCanvas1]")
; ================================================================================================
;not working just click on the current mouse position
ControlClick ($title, "", "[CLASSNN:SunAwtCanvas1]","left", 1, 216,390)
; ================================================================================================
; these works!!!
;MouseClick ( "primary" , 135, 417, 1, 11)
;MouseClick ( "primary" , 10, 200, 1, 1)

Share this post


Link to post
Share on other sites



I am having the same issue as BruceCopperField, running Autoit 3.3.0.0

- I never used to have this issue until recently

- ControlClick() worked without needing to resort to MouseMove() or MouseClick(),

but now, even with ControlClick() setting the focus to the correct Window, it does not use the correct coordinates,

so I am having to use MouseClick, which is not really an acceptable level of abstraction if controls change their location dynamically in a window with resizing.

It does not seem to make a difference which way I express the Control Name, whether as ClassnameNN, or Advanced.

It does not seem to matter whether I specify Opt("WinTitleMatchMode",1) or Opt("WinTitleMatchMode",4).

I have also noticed that AU3Info seems to be reporting varying Control x,y Coordinates at different times of execution.

Lately I have been having to add somewhere around 50 or more pixels to the value reported by AU3Info for MouseClick() events,

even after adding Position x,y to ControlClick Coords x,y, and even though the AU3Info Options.Coord Mode is set to Window, not Screen or Client,

and I set Opt("MouseCoordMode",0) in my .au3 code.

Is this being caused by some recent Windows patch interfering with Windows GUI Mouse Coord events?

Hopefully I'm just forgetting to set an appropriate Opt parameter, I cannot think what though...

Share this post


Link to post
Share on other sites

ControlClick() doesn't move the mouse, it sends a message to the control (or the window if no control is specified).

Also, the X/Y coordinates in ControlClick() are always relative to the control itself and do not depend on MouseCoordMode.

If you use ControlClick() on a SunAwtCanvas control, the X/Y coordinates will be relative to that control.

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

ControlClick() doesn't move the mouse, it sends a message to the control (or the window if no control is specified).

Also, the X/Y coordinates in ControlClick() are always relative to the control itself and do not depend on MouseCoordMode.

If you use ControlClick() on a SunAwtCanvas control, the X/Y coordinates will be relative to that control.

Posted Image

My description was not accurate enough. Let me clarify the problem a bit. The issue I encountered was the ControlClick() just clicked on the current mouse pointer position regardless of what x,y value I gave it - if the control I am trying to click on is a Java Applet control.

Edited by BruceCopperField

Share this post


Link to post
Share on other sites

Sorry for replying at old topic but I have same problem with AutoIt. Does anyone know the solution? Please help me :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I know only one java app that is using mouse pos as CC pos is runescape and its probably part of their bot protection. dono if its identical for other java apps newer tested it.

So if its game related, dont waits your time and read forum rules

http://www.autoitscript.com/forum/forum-6/announcement-13-forum-rules/

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.

 

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
Sign in to follow this  
Followers 0