Sign in to follow this  
Followers 0
redfive19

If this window EVER appears...

4 posts in this topic

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

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

You guys are both very generous!!! Thank you very much, worked a charm!

-redfive

Share this post


Link to post
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
Sign in to follow this  
Followers 0