Moorer

Skype Ad Blocker VB.NET

Apr 12th, 2014
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.52 KB | None | 0 0
  1. Imports Microsoft.Win32
  2.  
  3. 'Created by MooreR-Software.com
  4. 'Download Source + Binary @ http://moorer-software.com/old/.NET%20Projects/SkypeAdRemover.zip
  5.  
  6. Public Class Form1
  7.  
  8.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  9.  
  10.         Try
  11.  
  12.             Dim regSkype As RegistryKey = Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\skype.com\apps")
  13.             regSkype.SetValue("https", "00000004", RegistryValueKind.DWord)
  14.  
  15.             If CheckAds() Then
  16.                 IsEnabled()
  17.             End If
  18.  
  19.         Catch ex As Exception
  20.  
  21.         End Try
  22.  
  23.     End Sub
  24.  
  25.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  26.         IsEnabled()
  27.     End Sub
  28.  
  29.     Public Sub IsEnabled()
  30.  
  31.         If CheckAds() Then
  32.             Label1.ForeColor = Color.DarkGreen
  33.             Label1.Text = "Skype ads are disabled!"
  34.             Button1.Enabled = False
  35.         Else
  36.             Label1.ForeColor = Color.Red
  37.             Label1.Text = "Skype ads are enabled!"
  38.             Button1.Enabled = True
  39.         End If
  40.  
  41.     End Sub
  42.  
  43.     Public Function CheckAds() As Boolean
  44.  
  45.         Try
  46.  
  47.             If Registry.GetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\skype.com\apps", "https", "") Then
  48.                 Return True
  49.             End If
  50.  
  51.         Catch ex As Exception
  52.  
  53.         End Try
  54.  
  55.         Return False
  56.  
  57.     End Function
  58.  
  59. End Class
Advertisement
Add Comment
Please, Sign In to add comment