frank10 Posted June 23, 2005 Share Posted June 23, 2005 (edited) Hi to all. First, I want to thank the author for this awesome program! It is very useful. My problem is: I have a program that trigger a timed pop-up window with two buttons that change random every time the window appear (one shows "continue" & the other "Url page..."); they have the same text in the AutoIt Window Info and no different ControlID. Their className are Widget2 - widget1, but this refer to a button that can have both "continue" or "URL". You can only click the "enter" key or click with the mouse to go on. If you press the wrong button, you get an Url loaded in the default Browser and then another pop-up. Is there a way to detect where is the "continue" button? Thanks a lot for any tips. Greetings Edited June 23, 2005 by frank10 Link to comment Share on other sites More sharing options...
jpm Posted June 23, 2005 Share Posted June 23, 2005 (edited) Hi to all. First, I want to thank the author for this awesome program! It is very useful.My problem is:I have a program that trigger a timed pop-up window with two buttons that change random every time the window appear (one shows "continue" & the other "Url page..."); they have the same text in the AutoIt Window Info and no different ControlID. Their className are Widget2 - widget1, but this refer to a button that can have both "continue" or "URL".You can only click the "enter" key or click with the mouse to go on.If you press the wrong button, you get an Url loaded in the default Browser and then another pop-up.Is there a way to detect where is the "continue" button?Thanks a lot for any tips.Greetings<{POST_SNAPBACK}>use "AutoIt Window info" to determine the ClassnameNN.perhaps it is always the same whatever the position or the focus.If yes you can use the ControlClick on the right button. Edited June 23, 2005 by jpm Link to comment Share on other sites More sharing options...
frank10 Posted June 23, 2005 Author Share Posted June 23, 2005 (edited) use "AutoIt Window info" to determine the ClassnameNN.perhaps it is always the same whatever the position or the focus.If yes you can use the ControlClick on the right buttonthanks.Yes, I tried that and it gives me ClassNameNN: Widget2 on one button & widget1 on the rigth one, but their function is random, so they change on the same ClassName.what do you mean with ControlClick on right button?Edit: Neither button has a ControlID and the exact className is QWidget2-1 Edited June 23, 2005 by frank10 Link to comment Share on other sites More sharing options...
jpm Posted June 23, 2005 Share Posted June 23, 2005 thanks.Yes, I tried that and it gives me ClassNameNN: Widget2 on one button & widget1 on the rigth one, but their function is random, so they change on the same ClassName.what do you mean with ControlClick on right button?Edit: Neither button has a ControlID and the exact className is QWidget2-1<{POST_SNAPBACK}>so ControlID can be ClassnameNN use it with ControlGetText for both button and do the ControlClick on the button having the right text Link to comment Share on other sites More sharing options...
frank10 Posted June 24, 2005 Author Share Posted June 24, 2005 so ControlID can be ClassnameNN use it with ControlGetText for both button and do the ControlClick on the button having the right text <{POST_SNAPBACK}>Ok, no it doesn't work: with ControlGetText the buttons give the same text: "unnamed"I already tried that, also in the Autoit WindowsInfo there are these two visible window text: "unnamed, unnamed".I found out a workaround:I send a "Enter" key with a loop control until I guess the "continue" button (the window disappear). The drawback is that for every "URL" button I get a new Mozilla window. I solved that with a strict-name check to a window named "Mozilla" (the title window before the url is loaded).This is clearly a workaround, cause I want to exactly know where is the correct button, but it works.I would like to make this script more generic: I would intercept every type of Internet Window when I press the "URL" button, Internet Explorer, Firefox, Opera... So, how do you close a window just opened without knowning the title name?Thanks Link to comment Share on other sites More sharing options...
jpm Posted June 24, 2005 Share Posted June 24, 2005 Bad luck, I run out of fuel for the window title name does WinGetTitle("") works? You need to be for sure it is opened first perhpas some sleep(...) Link to comment Share on other sites More sharing options...
frank10 Posted June 24, 2005 Author Share Posted June 24, 2005 @jpm: Yes it could work. So I could test if after the first Enter key, the Window active has the name of the main program. Hmm, it should work. Thanks Has anyone else any idea about the button recognition problem to make the process cleaner? Link to comment Share on other sites More sharing options...
frank10 Posted June 25, 2005 Author Share Posted June 25, 2005 I have found the solution! You can control the color under mouse position in a window, so I checked in a position where the text of the different button differs and so the color is different. So checking the position of the left button where the color correspond to the "continue" button I send "Enter", while if the color is different there must be the "url" button, so I send "Tab" to swith to the other button and then "Enter". This works perfectly. Wow, great options to choose in Autoit! 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