sshrum Posted February 22, 2005 Posted February 22, 2005 I'm automating an install and this particular install has at the same point, 2 different outcomes. I need to be able to handle both occasions. How do I code for this? I can't use WinWaitActive as this only evaluates for 1 possibility. TIA Sean Shrum :: http://www.shrum.net All my published AU3-based apps and utilities 'Make it idiot-proof, and someone will make a better idiot'
Insolence Posted February 22, 2005 Posted February 22, 2005 If Else statement? If 1 = 1 Then ;First outcome Else ;Second outcome EndIf ? "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
sshrum Posted February 22, 2005 Author Posted February 22, 2005 It's going to be and If...then...else statement; but how? What's the trigger? You can't use WinWaitActive as, like I stated above, what if I get the alternate outcome: AutoIT locks waiting for the other dialog. I'm pretty sure this is a pretty standard sort of situation but my searches thru the forum haven't harvested anything that touches on this directly. Sean Shrum :: http://www.shrum.net All my published AU3-based apps and utilities 'Make it idiot-proof, and someone will make a better idiot'
Insolence Posted February 22, 2005 Posted February 22, 2005 Are there static colors? While PixelGetColor(x, y) = Color Sleep(100) WEnd "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
cal Posted February 24, 2005 Posted February 24, 2005 How about WinActive as the trigger? I've got a Case statement that makes a choice on what function to call depending on any of 16 different windows that are active at the time that I call the choice function with a hotkey. That way I can use just one hotkey and it does different things depending on what window has the focus. I'm sure you could use something similar.
sshrum Posted March 2, 2005 Author Posted March 2, 2005 (edited) I've got a Case statement that makes a choice on what function to call depending on any of 16 different windowsI've updated the code a bit to use this idea. Can you look at the snippet below and see if it looks right in regards to the Select statement using WinActive.While Not $done Select case WinActive("", "") ; <YOUR CODE HERE> case WinActive("", "") ; <YOUR CODE HERE> case WinActive("", "") ; <YOUR CODE HERE> case WinActive("", "") ; <YOUR CODE HERE> case WinActive("", ""); this should be the final install dialog ; <YOUR CODE HERE> $done = 1 case Else ; <YOUR CODE HERE> EndSelect WEndTIA Edited March 2, 2005 by sshrum Sean Shrum :: http://www.shrum.net All my published AU3-based apps and utilities 'Make it idiot-proof, and someone will make a better idiot'
Blue_Drache Posted March 2, 2005 Posted March 2, 2005 (edited) I've updated the code a bit to use this idea. Can you look at my installer script and see if it looks right in regards to the Select statement using WinActive.Code hereTIA<{POST_SNAPBACK}>While 1 Sleep(10) Select Case WinActive("Window One") ; window 1 possibility ExitLoop Case WinActive("Window Two") ; window 2 possibility ExitLoop EndSelect WEndLOL. Everyone's rushing to help the sshrum. Edited March 2, 2005 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
sshrum Posted March 2, 2005 Author Posted March 2, 2005 ExitLoop?!?! I was wondering about this but didn't see anything in the docs about it. In a Select statement, do you hae to 'Break' at the end of a case? (In this case 'ExitLoop'). In most other langs, you have to break otherwise all the remaining cases are evaluated down to the bottom. From what I've seen in the docs, I was under the impression that you didn't. Sean Shrum :: http://www.shrum.net All my published AU3-based apps and utilities 'Make it idiot-proof, and someone will make a better idiot'
Blue_Drache Posted March 2, 2005 Posted March 2, 2005 ExitLoop?!?!I was wondering about this but didn't see anything in the docs about it.In a Select statement, do you hae to 'Break' at the end of a case? (In this case 'ExitLoop'). In most other langs, you have to break otherwise all the remaining cases are evaluated down to the bottom.From what I've seen in the docs, I was under the impression that you didn't.<{POST_SNAPBACK}>The ExitLoop is to break out of the While/WEnd Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
sshrum Posted March 2, 2005 Author Posted March 2, 2005 FYI: WinExists seems to work better then WinActive Sean Shrum :: http://www.shrum.net All my published AU3-based apps and utilities 'Make it idiot-proof, and someone will make a better idiot'
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