Sign in to follow this  
Followers 0
khandan

How I can CLick somewhere in a window

7 posts in this topic

#1 ·  Posted (edited)

I want to left click on this windows by ControlClick or MouseClick, I can get anything, if i'm using right command which position I should give to it (ControlClick cor or Mouse one),

Thanks that will help me alot.

these are what AutoIt Info gives me:

>>> Window <<<<

Title: CLIMEX - Compare Locations (1 species)

Class: Afx:00400000:8:00010005:00000000:34FC0249

Position: 125, 125

Size: 1080, 625

Style: 0x14CF0000

ExStyle: 0x00000110

Handle: 0x008302AC

>>>> Control <<<<

Class: AfxWnd70

Instance: 2

ClassnameNN: AfxWnd702

Name:

Advanced (Class): [CLASS:AfxWnd70; INSTANCE:2]

ID: 1

Text:

Position: 12, 74

Size: 741, 158

ControlClick Coords: 39, 127

Style: 0x56000000

ExStyle: 0x00000000

Handle: 0x00190A42

>>>> Mouse <<<<

Position: 184, 376

Cursor ID: 0

Color: 0xFFFFFF

>>>> StatusBar <<<<

1: Ready

2: Model: Loaded

3: Parameters : H:\M...\Compare Locations (1 species).gmp

4: Unmodified

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

Edited by khandan

Share this post


Link to post
Share on other sites



What did you try for ControlClick()?

:mellow:

==

I saw in some examples and based on what I read:( , is it wrong?I am beginner.then what commad I should use to open something in a window?

Cheers

Share this post


Link to post
Share on other sites

You can left click on the middle of the window like this :

WinWait ( 'CLIMEX - Compare Locations (1 species)', '' )
WinActivate ( 'CLIMEX - Compare Locations (1 species)', '' )
$_WinPos = WinGetPos ( 'CLIMEX - Compare Locations (1 species)', '' ) 
MouseClick ( 'Left', $_WinPos[0]+$_WinPos[2]/2, $_WinPos[1]+$_WinPos[3]/2, 1 )

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

I saw in some examples and based on what I read:( , is it wrong?I am beginner.

What I meant was "Please post the actual code line for ControlClick() that you used, so we can see if your usage was correct." As a general rule, you can't get much help here without posting some example code for us to look at. It is very helpful that you posted the AU3Info output, just post also how you used that info in your ControlClick().

:mellow:


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

You can left click on the middle of the window like this :

WinWait ( 'CLIMEX - Compare Locations (1 species)', '' )
WinActivate ( 'CLIMEX - Compare Locations (1 species)', '' )
$_WinPos = WinGetPos ( 'CLIMEX - Compare Locations (1 species)', '' ) 
MouseClick ( 'Left', $_WinPos[0]+$_WinPos[2]/2, $_WinPos[1]+$_WinPos[3]/2, 1 )

Thanks,that's aswesome , but can u explain it a bit? I read this commands but how you define [0] and [2]/2 ? or [3]/2 ?I just know these r x&y but don't have a clue who they lead to clicking in the middle of window.

Share this post


Link to post
Share on other sites

Thanks,that's aswesome , but can u explain it a bit? I read this commands but how you define [0] and [2]/2 ? or [3]/2 ?I just know these r x&y but don't have a clue who they lead to clicking in the middle of window.

It's the window coordinates and i add the half of window size for get the center ! Posted Image

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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