Jump to content

Recommended Posts

Posted

then:

CODE

If WinActive("ur program's title")<>"true" then

;w/e u need to do

endif

Don't know how you got that quote (my computer is lagging intensely at the moment) but your code requires me to know the title, I don't know the title is the problem. Really i I need a command that will tell me the title of a window that pops up.

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
Posted

Don't know how you got that quote (my computer is lagging intensely at the moment) but your code requires me to know the title, I don't know the title is the problem. Really i I need a command that will tell me the title of a window that pops up.

so ur script is going to be a background process?...

[sup]Psibernetic[/sup]My Creations:X-HideSecuracy

Posted

because then u could set the WinActive to monitor whichever app u need to keep pop ups away from with the code I gave u... if $Whatever_u_need_active isn't active then (w/e u need it to do)

Ah, I see now. Sorry, didn't understand what "w/e" meant. Thanks

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
  • Moderators
Posted (edited)

Might see where this takes you :

Global $aAllVisWin = ''
AdlibEnable('_GetPopUp', 100)

While 1
    Sleep(10000)
WEnd

Func _GetPopUp()
    AdlibDisable()
    If Not $aAllVisWin Then
        Local $aWL = WinList()
        For $iCC = 1 To UBound($aWL) - 1
            If $aWL[$iCC][0] <> '' And _
                BitAND(WinGetState($aWL[$iCC][0]), 2) Then _
                $aAllVisWin &= $aWL[$iCC][0] & Chr(1)
        Next
    Else
        Local $sTitle = WinGetTitle('')
        If $sTitle <> '' And _
            Not StringInStr(Chr(1) & $aAllVisWin, Chr(1) & $sTitle & Chr(1)) Then
            MsgBox(64, 'Info', 'Extra Window:' & @CRLF & $sTitle)
        EndIf
    EndIf
    AdlibEnable('_GetPopUp', 100)
    Return ''
EndFunc

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

Might see where this takes you :

Global $aAllVisWin = ''
AdlibEnable('_GetPopUp', 100)

While 1
    Sleep(10000)
WEnd

Func _GetPopUp()
    AdlibDisable()
    If Not $aAllVisWin Then
        Local $aWL = WinList()
        For $iCC = 1 To UBound($aWL) - 1
            If $aWL[$iCC][0] <> '' And _
                BitAND(WinGetState($aWL[$iCC][0]), 2) Then _
                $aAllVisWin &= $aWL[$iCC][0] & Chr(1)
        Next
    Else
        Local $sTitle = WinGetTitle('')
        If $sTitle <> '' And _
            Not StringInStr(Chr(1) & $aAllVisWin, Chr(1) & $sTitle & Chr(1)) Then
            MsgBox(64, 'Info', 'Extra Window:' & @CRLF & $sTitle)
        EndIf
    EndIf
    AdlibEnable('_GetPopUp', 100)
    Return ''
EndFunc
Awesome, thanks too.
[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
  • Moderators
Posted (edited)

Awesome, thanks too.

This could get quite annoying...

Anyway, you might think about giving an option to kill it / Add it etc...

Global $aAllVisWin = '', $sWins2Kill
AdlibEnable('_GetPopUp', 10)

While 1
    Sleep(10000)
WEnd

Func _GetPopUp()
    AdlibDisable()
    If Not $aAllVisWin Then
        Local $aWL = WinList()
        For $iCC = 1 To UBound($aWL) - 1
            If $aWL[$iCC][0] <> '' And _
                BitAND(WinGetState($aWL[$iCC][0]), 2) Then _
                $aAllVisWin &= $aWL[$iCC][0] & Chr(1)
        Next
    Else
        Local $sTitle = WinGetTitle('')
        If $sTitle <> '' And _
            Not StringInStr(Chr(1) & $aAllVisWin, Chr(1) & $sTitle & Chr(1)) Then
            If StringInStr(Chr(1) & $sWins2Kill, Chr(1) & $sTitle & Chr(1)) Then
                WinKill($sTitle)
            ElseIf MsgBox(262144 + 68, 'New Window Detected!', 'Window not recognized:' & @CRLF & @CRLF & _
                'Window Name:  --> "' & $sTitle & '"' & @CRLF & @CRLF & _
                'Would you like to kill it?') = 6 Then
                $sWins2Kill &= $sTitle & Chr(1)
                WinKill($sTitle)
            Else
                $aAllVisWin &= $sTitle & Chr(1)
            EndIf
        EndIf
    EndIf
    AdlibEnable('_GetPopUp', 10)
    Return ''
EndFunc

Edit:

Revised it a bit more (didn't make it an option, you can do that).

Now if you kill the window, it's added to the do not allow list, so you won't keep getting the message box.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

I built a popup blocker into my browser by using adlibenable on a function that just killed iexplore.... but of course if that kills ALL it's windows... so it may not work in your case.

Posted

Is it possible to block out ip's with autoit? For instance, you make a file with all the ad links/converted to IP's and just have it so that if that IP connects, it won't let it or close it immediately.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...