Connecting Tech Pros Worldwide Help | Site Map

creating a Popup Stopper program

Sam Learner
Guest
 
Posts: n/a
#1: Nov 21 '05
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


scorpion53061
Guest
 
Posts: n/a
#2: Nov 21 '05

re: creating a Popup Stopper program


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).Docum ent.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/is...e/default.aspx



"Sam Learner" <Samuel@easynetsoft.dynu.com> wrote in message
news:#gtkTB6rEHA.1816@TK2MSFTNGP15.phx.gbl:[color=blue]
> 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[/color]

Bonj
Guest
 
Posts: n/a
#3: Nov 21 '05

re: creating a Popup Stopper program


my example (wrote it ages ago)

http://www.planet-source-code.com/vb...2091&lngWId=10

let me know what you think


"Sam Learner" wrote:
[color=blue]
> 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
>
>
>[/color]
scorpion53061
Guest
 
Posts: n/a
#4: Nov 21 '05

re: creating a Popup Stopper program


Very Very Good.

"Bonj" <Bonj@discussions.microsoft.com> wrote in message
news:35C6937D-A81C-4ABC-9160-D9979E40CFCF@microsoft.com:[color=blue]
> my example (wrote it ages ago)
>
>
> http://www.planet-source-code.com/vb...odeId=2091&lng
> WId=10
>
> let me know what you think
>
>
> "Sam Learner" wrote:
>[color=green]
> > 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
> >
> >
> >[/color][/color]

Steve Long
Guest
 
Posts: n/a
#5: Nov 21 '05

re: creating a Popup Stopper program


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

"scorpion53061" <admin@nospamherekjmsolutions.com> wrote in message
news:OMhHWS6rEHA.536@TK2MSFTNGP11.phx.gbl...[color=blue]
> 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).Docum ent.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/is...e/default.aspx
>
>
>
> "Sam Learner" <Samuel@easynetsoft.dynu.com> wrote in message
> news:#gtkTB6rEHA.1816@TK2MSFTNGP15.phx.gbl:[color=green]
> > 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[/color]
>[/color]


Closed Thread