Jump to content

Sending mouse click command to button that has focus


Recommended Posts

Hi,

Is it possible to send a mouse click command to a button that has focus? I am setting focus to the button by tabbing to it. I cannot rely on mouse coordinates as I wish to run the script on different computers with different resolutions etc. Unfortunately I am unable to "click" the button using space, enter or any other keys for that matter. :-(

Also, I cannot set focus to the button using using controlFocus (and hence controlClick) as the button resides in an ActiveX component and therefore cannot be identified.

Thanks

Edited by KonnectTest
Link to comment
Share on other sites

Try ControlClick() either with "" for the ControlID, or just use the ID of the ActiveX control.

:D

Thanks for your reply. Unfortunately no variations of your suggestion worked. :-( The best result I achieved was a "click" which seemed like it was right in the middle of the page.

Link to comment
Share on other sites

Post what you get on the Summary tab of the AutoIt Window Info Tool (AU3Info.exe) when you look at 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
Link to comment
Share on other sites

Ah, snap! That makes it easy. What you have is an embedded instance of IE. Look in the help file at the _IE* functions of Dale's IE.au3 UDF. Get an object reference to the embedded browser with _IEAttach() and handle it like you would any other IE web page automation.

$oIE = _IEAttach("New Request Form", "Embedded")

: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
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

  • Recently Browsing   0 members

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