Jump to content

If this window EVER appears...


Recommended Posts

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")
EndIf

I 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

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

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 by burrup

qq

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...