carefree Posted January 22, 2009 Share Posted January 22, 2009 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 More sharing options...
FireFox Posted January 22, 2009 Share Posted January 22, 2009 @carefree Maybe... WinActivate('****') WinWaitActive('****', '', 2) WinSetTitle('[ACTIVE]', '', 'aaa') WinActivate('****') WinWaitActive('****', '', 2) WinSetTitle('[ACTIVE]', '', 'bbb') Cheers, FireFox. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 22, 2009 Share Posted January 22, 2009 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 More sharing options...
carefree Posted January 23, 2009 Author Share Posted January 23, 2009 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 More sharing options...
PsaltyDS Posted January 23, 2009 Share Posted January 23, 2009 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 More sharing options...
carefree Posted January 24, 2009 Author Share Posted January 24, 2009 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now