Jump to content
Sign in to follow this  
Noviceatthis

ControlClick

Recommended Posts

Noviceatthis

Hello all

I saw this script in another topic and one part confused me slightly

Send("#r")
Sleep(1000)
$hHandle = WinGetHandle("Run")
MsgBox(64, "Window Handle", 'Now this will click the "Cancel" button using >> WinGetHandle("' & $hHandle & '")')
ControlClick($hHandle, "", "[CLASS:Button; INSTANCE:3]")

in the last line, (i'm assuming the the $hHandle is the title) how are you meant to determine the instance number, especially when applied to a GUI with a lot of buttons.

Apologies if this is a stupid question

Share this post


Link to post
Share on other sites
DOTCOMmunications

I tend to use the AutoIT Window Info tool that comes with AutoIT to do this, it is on the control tab once you drag the target over the required control, not sure if there is any other way though

Share this post


Link to post
Share on other sites
Noviceatthis

ah I see, yeh just tried it, thank you DOTCOMmunications

Share this post


Link to post
Share on other sites
Noviceatthis

one more quick question, is there any way to use the mousemove function to jump to the stated instance, just for visual effect

*ah, just figured it out, thanks again

Edited by Noviceatthis

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  

×