Jump to content

MouseClick


Recommended Posts

I am new to autoit and am having an issue

i want to move a mouse to particular tree structure in a active window and then click on it.

the window does not take keystrokes.

how to click via mouseclick or controlclick?

can anyone help?

Link to comment
Share on other sites

What program? Any chance to try it on my own?

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

If the tree structure is always in the same place, then you can just use mouseclick() or controlclick() like you said.

If it's not, then most likely you'll need to identify the window/control/text which can be used to uniquely identify the tree structure and use relative coordinates.

You don't give much info or ask anything in particular so it's difficult to help.

The best I can do is say: Look at the help for mouseclick(), controlclick(), MouseCoordMode, ControlGetPos ... maybe others relating to control

Link to comment
Share on other sites

the issue is that i need to click on a node of the tree which remains at a fixed position.

i used controlclick as

ControlClick("Administrator", "Datasbase", "[CLASS:SysTreeView32; INSTANCE:1]","right", 1, 358, 291)

but it does not work.

what is the error?

I have specified the coordinates which i got using AutoitWindowInfo.

if i use

WinWaitActive("Administrator")

MouseMove(290,245)

MouseClick("right")

then it works but i think the coordinates would change each time as cooordinates would be machine specific.

so how to make it robust to run on any machine?

Link to comment
Share on other sites

What's the return from Controlclick()?

You can try to remove the "database" portion.

Can you post/link a screenshot with the AutoitWindowinfo locked on the tree?

The relative coordinates should remain the same if the window doesn't resize to a size that the tree can't be seen properly (YOu could Maximize before you begin, but that's another story. First get the click to work.)

Just btw, you can use MouseClick("Right",290,245), it moves the mouse before it clicks.

Link to comment
Share on other sites

Hey

Your original code was pretty close

Try this. Note I used a left click, just check if the left click selects it then change it to right click.

Opt("Wintitlematchmode",2)
ControlClick("Administrator","","[CLASS:SysTreeView32; INSTANCE:1]","left",1,76,56)

If the right click doesn't bring up the context menu the you can either do the task with only left click (i.e. using the edit or file menu etc) or you can try this to simulate Shift+F10 after left click (I know you said it doesn't accept keystrokes, but just try and see)

Opt("Wintitlematchmode",2)
ControlClick("Administrator","","[CLASS:SysTreeView32; INSTANCE:1]","left",1,76,56)
ControlSend("Administrator","","[CLASS:SysTreeView32; INSTANCE:1]","+{F10}")

Edit: Next time just make the image a jpg instead of bmp please (150k vs 3mb)

Edited by hawky358
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...