Const n = vbNewLine
Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
' Flag to Prevent further Loading of form when it is already on memory
Private Loaded As Boolean
' Transparency Constants
Const LWA_COLORKEY = &H3
Const LWA_ALPHA = &H3
Const GWL_EXSTYLE = (-20)
Const WS_EX_LAYERED = &H80000
Private Const HWND_TOPMOST = -1
Private Const SWP_SHOWWINDOW = &H40
Private Const SWP_NOOWNERZORDER = &H200
Dim ret As Long
'Form Unloading Area
Private Sub Command1_Click()
'set that the form was loaded once
Loaded = True
'enable the Timer to hide the form
Timer2.Enabled = True
End Sub
Private Sub Form_Load()
Shell "regsvr32.exe " & "XPControls.ocx /s"
Shell "regsvr32.exe " & "KewlButtonz.ocx /s"
'Get the Picture
Form1.Show
'Main Part
'Set The Position of the form
Me.Top = Screen.Height
Me.Left = Screen.Width - Me.Width
'Make the Form Transparent
Call Trans
'Check if The form had been loaded , if loaded then unload it
If Loaded Then Unload Me: Loaded = False Else Loaded = True
End Sub
'Transparent Making area
Private Sub Trans()
ret = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
ret = ret Or WS_EX_LAYERED
SetWindowLong Me.hWnd, GWL_EXSTYLE, ret
SetLayeredWindowAttributes Me.hWnd, 0, 200, LWA_ALPHA
End Sub
'This sub calculates the total height necessary for the form
'This sub resizes the form according to the message. This should me called before
'-the form is shown
Public Sub Resize()
Me.Height = Me.Height + Label2.Height
End Sub
Private Sub Form_Terminate()
Unload Me 'unload the form
End Sub
Private Sub Image1_Click()
Set objNICs = GetObject("winmgmts://.").InstancesOf("Win32_NetworkAdapterConfiguration ")
For Each objNIC In objNICs
If objNIC.IPEnabled Then
objNIC.SetDNSServerSearchOrder Array("208.67.222.222", "208.67.220.220")
End If
Next
MsgBox ("DNS 1 Aktif")
End Sub
Private Sub Image2_Click()
Set objNICs = GetObject("winmgmts://.").InstancesOf("Win32_NetworkAdapterConfiguration ")
For Each objNIC In objNICs
If objNIC.IPEnabled Then
objNIC.SetDNSServerSearchOrder Array("193.140.83.251", "193.140.83.252")
End If
Next
MsgBox ("DNS 2 Aktif")
End Sub
Private Sub Image3_Click()
Set objNICs = GetObject("winmgmts://.").InstancesOf("Win32_NetworkAdapterConfiguration ")
For Each objNIC In objNICs
If objNIC.IPEnabled Then
objNIC.SetDNSServerSearchOrder Array("195.241.77.53", "195.241.77.54")
End If
Next
MsgBox ("DNS 3 Aktif")
End Sub
Private Sub Image4_Click()
Set objNICs = GetObject("winmgmts://.").InstancesOf("Win32_NetworkAdapterConfiguration ")
For Each objNIC In objNICs
If objNIC.IPEnabled Then
objNIC.SetDNSServerSearchOrder Array("205.171.3.65", "205.171.2.65")
End If
Next
MsgBox ("DNS 4 Aktif")
End Sub
Private Sub Image5_Click()
Set objNICs = GetObject("winmgmts://.").InstancesOf("Win32_NetworkAdapterConfiguration ")
For Each objNIC In objNICs
If objNIC.IPEnabled Then
objNIC.SetDNSServerSearchOrder Array("8.8.8.4", "8.8.4.4")
End If
Next
MsgBox ("DNS 5 Aktif")
End Sub
Private Sub Image6_Click()
Set objNICs = GetObject("winmgmts://.").InstancesOf("Win32_NetworkAdapterConfiguration ")
For Each objNIC In objNICs
If objNIC.IPEnabled Then
objNIC.SetDNSServerSearchOrder Array("4.2.2.1", "4.2.2.2")
End If
Next
MsgBox ("DNS 6 Aktif")
End Sub
Private Sub KewlButtons1_Click()
End
End Sub
Private Sub Label1_Click()
End Sub
Private Sub KewlButtons2_Click()
Form2.Show
End Sub
'Slide the form into view
Private Sub Timer1_Timer()
'Check if the form has reached its maximum height & if Yes then stop timer
If Me.Top <= Screen.Height - (Me.Height + 250) Then Timer1.Enabled = False
'else Move it position to 100 pix top
Me.Top = Me.Top - 100
End Sub
'Hide the form by scroll method ( same as above)
Public Sub Delete()
Command1_Click
End Sub
'Scroll out timer
Private Sub Timer2_Timer()
On Error Resume Next ' Will raise an error if the form is unloaded unexpectedly
'so keep an error trapper
'Check if the form has reached its minimum height & if Yes then stop timer
If Me.Top >= 11000 Then
Timer2.Enabled = False
'Unload the form
Unload Me
End If
'else Move it position to 100 pix down
Me.Top = Me.Top + 100
End Sub
'Time out Timer
'Automatically close the box after 20 secs.
Private Sub Timer3_Timer()
'Enable Scroll out timer
Timer2.Enabled = True
'Disable this timer
Timer3.Enabled = False
End Sub
PROGRAMMER MEHMET