redfive19 Posted April 5, 2005 Share Posted April 5, 2005 Hi guys,I searched first for this but to no avail. Maybe I didn't use the correct search criteria. Either way, I am trying to have AutoIt close a window if and whenever it appears. Case in point....sometimes a Found New Hardware wizard window pops up, sometimes it doesn't. Sometimes it pops up once, sometimes twice. It's very incosistent. I basically want AutoIt to close the window anytime it pops up. I tried using a "while" expression but it hangs and doesn't execute the rest of the script. The rest of the script installs the drivers (which Windows doesn't have by default)....If WinExists("Found New Hardware Wizard", "") Then WinActivate("Found New Hardware", "hp LaserJet 3030") ControlClick("Found New Hardware Wizard", "hp LaserJet 3030", "Button6") EndIfI want to do this each and everytime the window pops up. Maybe someone can point me in the right direction? Thanks in advance.-redfive Link to comment Share on other sites More sharing options...
CyberSlug Posted April 5, 2005 Share Posted April 5, 2005 AdlibEnable("GetRidOfPopup") ; your main script stuff goes here.... Exit Func GetRidOfPopup() If WinExists("Found New Hardware Wizard", "") Then WinActivate("Found New Hardware", "hp LaserJet 3030") ControlClick("Found New Hardware Wizard", "hp LaserJet 3030", "Button6") EndIf EndFunc Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
buzz44 Posted April 5, 2005 Share Posted April 5, 2005 (edited) Put it in a loop so its continously running. While 1 If WinExists("Found New Hardware Wizard", "") Then WinActivate("Found New Hardware", "hp LaserJet 3030") ControlClick("Found New Hardware Wizard", "hp LaserJet 3030", "Button6") EndIf Wend Beat me to it CyberSlug Edited April 5, 2005 by burrup qq Link to comment Share on other sites More sharing options...
redfive19 Posted April 5, 2005 Author Share Posted April 5, 2005 You guys are both very generous!!! Thank you very much, worked a charm! -redfive 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