Sign in to follow this  
Followers 0
carefree

about 'controlclick'

6 posts in this topic

use controlclick in two windows with the same title ... sometime it does not work ,any idea to improve? thanks!

part of my script:

WinSetTitle("****","","aaa")

WinSetTitle("****","","bbb")

$b = WinGetHandle("bbb")

$a=WinGetHandle("aaa")

Dim $i=8

While $i

ControlClick("","",$b,"left",1,588,539)

Sleep(500)

ControlClick("","",$b,"left",1,550,539)

Sleep(500)

ControlClick("","",$a,"left",1,588,539)

Sleep(500)

ControlClick("","",$a,"left",1,550,539)

$i=$i-1

WEnd

Share this post


Link to post
Share on other sites



@carefree

Maybe...

WinActivate('****')
WinWaitActive('****', '', 2)
WinSetTitle('[ACTIVE]', '', 'aaa')

WinActivate('****')
WinWaitActive('****', '', 2)
WinSetTitle('[ACTIVE]', '', 'bbb')

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

use controlclick in two windows with the same title ... sometime it does not work ,any idea to improve? thanks!

part of my script:

WinSetTitle("****","","aaa")

WinSetTitle("****","","bbb")

$b = WinGetHandle("bbb")

$a=WinGetHandle("aaa")

Dim $i=8

While $i

ControlClick("","",$b,"left",1,588,539)

Sleep(500)

ControlClick("","",$b,"left",1,550,539)

Sleep(500)

ControlClick("","",$a,"left",1,588,539)

Sleep(500)

ControlClick("","",$a,"left",1,550,539)

$i=$i-1

WEnd

Use the window handles instead. Also, your $a and $b are window handles and don't belong in the third parameter of ControlClick():
$avWinList = WinList("****", "")

For $i = 1 To 8
    For $n = 1 To $avWinList[0][0]
        ControlClick($avWinList[$n][1], "", "", "left", 1, 588, 539)
        Sleep(500)
        ControlClick($avWinList[$n][1], "", "", "left", 1, 550, 539)
        Sleep(500)
    Next
Next

:)


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

Use the window handles instead. Also, your $a and $b are window handles and don't belong in the third parameter of ControlClick():

$avWinList = WinList("****", "")

For $i = 1 To 8
    For $n = 1 To $avWinList[0][0]
        ControlClick($avWinList[$n][1], "", "", "left", 1, 588, 539)
        Sleep(500)
        ControlClick($avWinList[$n][1], "", "", "left", 1, 550, 539)
        Sleep(500)
    Next
Next

:)

thx ,but i don't understand..

the $avWinList[1][1] = $a ,$avWinList[2][1] = $b whether the title was changed, my english is poor...

Share this post


Link to post
Share on other sites

thx ,but i don't understand..

the $avWinList[1][1] = $a ,$avWinList[2][1] = $b whether the title was changed, my english is poor...

The code I posted uses WinList() to get an array of all windows with a matching title. This makes changing the titles in order to recognize the different windows unnecessary. The array contains the handles to the windows, which are unique even if the titles match. The loop then uses the handles to identify each window and pass the two ControlClick() to each.

I don't understand your reference to "$avWinList[1][1] = $a ,$avWinList[2][1] = $b" since that does not appear in my code. The window handles are being used directly from the array without copying them to $a and $b in my code.

:)


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

The code I posted uses WinList() to get an array of all windows with a matching title. This makes changing the titles in order to recognize the different windows unnecessary. The array contains the handles to the windows, which are unique even if the titles match. The loop then uses the handles to identify each window and pass the two ControlClick() to each.

I don't understand your reference to "$avWinList[1][1] = $a ,$avWinList[2][1] = $b" since that does not appear in my code. The window handles are being used directly from the array without copying them to $a and $b in my code.

:)

thanks a lot!

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