Jump to content

about 'controlclick'


 Share

Recommended Posts

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

Link to comment
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
Link to comment
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...

Link to comment
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
Link to comment
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!
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...