Jump to content
Sign in to follow this  
nick21

MouseClick a Button Question

Recommended Posts

nick21

I am making a AutoInstall exe file to auto install some program I have.

I know that

Send ("!n")

can trigger it to click the next button, but now I come to the FINISH button where

Send ("!f") does not work, what command would I be able to to use to have it click that.

Yeah I know I can do a mouse click function but I would have to yet the X,Y cor. but I wanted it just to auto click that button.

Is there an Instance, with/Class command I could use or something.

Here is the info:

Class: Button

Instance: 4

ClassnameNN: Button4

ID: 1

Text: Finish

any help would be great,

thanks,

nick

Share this post


Link to post
Share on other sites
Pain

Send is unreliable, use ControlSend and ControlClick.

Btw hold down alt and one of the letters will get a underscore, alt + this letter is the shortkey.

Finish doesn't use to have a shortkey but it's the default button so Send("{ENTER}") should work.

Edited by Pain

Share this post


Link to post
Share on other sites
nick21

Send is unreliable, use ControlSend and ControlClick.

Btw hold down alt and one of the letters will get a underscore, alt + this letter is the shortkey.

Finish doesn't use to have a shortkey but it's the default button so Send("{ENTER}") should work.

I am trying to learn some code so I am trying it this way. What am I doing wrong??

From AutoIt Window Viewer

>>>> Control <<<<
Class:  Button
Instance:   4
ClassnameNN:    Button4
ID: 1
Text:   Finish
Position:   323, 319
Size:   75, 23
ControlClick Coords:    28, 4
Style:  0x50010001
ExStyle:    0x00000004
Handle: 0x002C00F4

I am trying this code:

ControlClick("My Window", "", "[CLASS:Button; TEXT:Finish; INSTANCE:2]")

Here is my edit:

Controlclick ("3D program", "InstallShield Wizard Complete", "[CLASS:Button; TEXT:Finsih; INSTANCE:4]")

Share this post


Link to post
Share on other sites
zero57

I am making a AutoInstall exe file to auto install some program I have.

I know that

Send ("!n")

can trigger it to click the next button, but now I come to the FINISH button where

Send ("!f") does not work, what command would I be able to to use to have it click that.

Yeah I know I can do a mouse click function but I would have to yet the X,Y cor. but I wanted it just to auto click that button.

Is there an Instance, with/Class command I could use or something.

Here is the info:

Class: Button

Instance: 4

ClassnameNN: Button4

ID: 1

Text: Finish

any help would be great,

thanks,

nick

The Send("") isn't always great. This is why they made MouseClick and MouseMove. So im going to tell u how to get the

coords for MouseClick/MouseMove.

First: Open up Autoit Window Info by Start > All Programs > Autoit V3 > Autoit Window Info

Second: U could move the window info around if the window is blocking the button, and Click the "Mouse" tab.

Third: Move ur mouse over the button, Notice that there is a word called "Position", well beside it HAS UR COORDS!!!!

E.G.: My mouse coords is "446, 531"

Fourth: U could just write the position on the paper, OR The copy and paste way :).

Copy and Paste Way: Hold Alt and keep on pressing Tab until the thing says "Autoit Window Info" This will keep ur position

until u click outside the window info. Now, Click the "Summary" Tab, and scroll down a bit until u see the Position word.

Use ur mouse and Copy the coords, in this case i just copied my coords "446, 531" and pasted it into my script.

E.G.:

MouseClick("left", 446, 531)

OR

MouseMove(446, 531)
MouseClick("Left")

Hope this helps :lmao:

Edited by zero57

[font="Arial Black"][u]zero57[/u][/font]

Share this post


Link to post
Share on other sites
PsaltyDS

I am trying to learn some code so I am trying it this way. What am I doing wrong??

From AutoIt Window Viewer

>>>> Control <<<<
Class:  Button
Instance:   4
ClassnameNN:    Button4
ID: 1
Text:   Finish
Position:   323, 319
Size:   75, 23
ControlClick Coords:    28, 4
Style:  0x50010001
ExStyle:    0x00000004
Handle: 0x002C00F4

I am trying this code:

ControlClick("My Window", "", "[CLASS:Button; TEXT:Finish; INSTANCE:2]")

Here is my edit:

Controlclick ("3D program", "InstallShield Wizard Complete", "[CLASS:Button; TEXT:Finsih; INSTANCE:4]")
Just drop the text and try:
ControlClick("3D program", "InstallShield Wizard Complete", "[CLASS:Button; INSTANCE:4]")

:)


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
Authenticity

Rofl, thanks for the short tutorial, but if the window is moved by the user you're going to click something else in this position.

ControlClick is more reliable the Send or MouseClick in this cases.

@nick21: From what I can see it's actually Button4. You can always preform mouse click amount of pixel up and left from the bottom right corner of the window because dialogs usually aren't resizeable, there are quite few more ways to accomplish this task.

Edited by Authenticity

Share this post


Link to post
Share on other sites
nick21

@ PsaltyDS

Thank you that worked like a charm.

Thanks to everyone in helping me out.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.