creating a Popup Stopper program

  • Thread starter Thread starter Sam Learner
  • Start date Start date
S

Sam Learner

Hi Everyone,
I'd like to create my own Internet Popup windows Stopping program.
Is there any code I could you to monitor when IE or Netscape opens a Windows
from a clicked Link?
how about managed class, is there any?

Please help.

SJ
 
Const ForReading = 1
on error resume Next
strFileName = "DomainList.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objDictionary = CreateObject("Scripting.Dictionary")
Set objArgs = WScript.Arguments

If objArgs.Count > 0 Then
If objFSO.FileExists(objArgs(0)) Then
strFileName = objArgs(0)
End If
End If

If objFSO.FileExists(strFileName) Then
Set objTextFile = objFSO.OpenTextFile(strFileName, ForReading)

Do While objTextFile.AtEndOfStream <> True
strNextLine = lcase(trim(objTextFile.Readline))
'Checking the length to avoid adding blank lines...
If Len(strNextLine) > 0 Then
objDictionary.Add strNextLine,strNextLine
End If
Loop
End If

For Each objItem in objDictionary
WScript.Echo "Domain : " & Trim(objDictionary.Item(objItem))
Next


Set J=CreateObject("Shell.Application")
Do
WScript.StdOut.Write Now
WScript.Sleep 900
WScript.StdOut.Write String(Len(Now),Chr(8))
For L=0 to J.windows.count-1
With J.windows.item(L)
If IsObject(J.windows.Item(L).document.frames) Then
If isObject(J.Windows.Item(L).document.frames.opener) Then
If
objDictionary.Exists(lcase(J.Windows.Item(L).Document.Domain)) Then
'WScript.Echo Now & " Popup window from protected domain " &
J.Windows.Item(L).Document.Domain
Else
WScript.Echo Now & " Closing Popup Window from " &
J.Windows.Item(L).Document.Domain
J.Windows.Item(L).document.frames.close
End If
End If
End If
End With
Next
Loop

OR

http://msdn.microsoft.com/msdnmag/issues/02/04/ednote/default.aspx
 
Scorpion,
you might want to strip those:
On Error Resume Next statements out of your .NET code. From what I
understand, the compiler sticks a Try Catch block around every line of code
when you do this.
Ouch

Steve
 
Back
Top