AmJano (18.10.2012), Dbzfreak1337 (18.10.2012), DnL (18.10.2012), Gangstersheep (18.10.2012), getsha (02.10.2020), Pwned (19.10.2012)
-
18.10.2012, 19:23 #1
[VB.Net] Antivir einblendeffekt
Antivir einblendeffekt
Blendet eine Form langsam rechts unten über der Taskleite ein.
Wird benötigt
- 1x Windows Form (Name: Popup)
PHP-Code:
Public Class Popup
Private y As Integer
Private t As Threading.Thread
Delegate Sub SetLocationCallback(ByVal location As Point)
Delegate Sub CloseCallback()
Private Sub SetLocation(ByVal location As Point)
If Me.InvokeRequired Then
Dim d As New SetLocationCallback(AddressOf SetLocation)
Me.Invoke(d, New Object() {[location]})
Else
Me.Location = location
End If
End Sub
Private Sub _Close()
If Me.InvokeRequired Then
Dim d As New CloseCallback(AddressOf _Close)
Me.Invoke(d)
Else
Me.Close()
End If
End Sub
Private Sub Popup_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.y = My.Computer.Screen.WorkingArea.Height + Me.Height
Me.TopMost = True
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Me.Location = New Point(My.Computer.Screen.WorkingArea.Width - Me.Width, y)
Me.t = New Threading.Thread(AddressOf _show)
Me.t.Start()
End Sub
Private Sub Popup_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Me.t = New Threading.Thread(AddressOf _hide)
Me.t.Start()
End Sub
Private Sub _show()
While Me.Location.Y >= My.Computer.Screen.WorkingArea.Height - Me.Height + 50
Me.SetLocation(New Point(My.Computer.Screen.WorkingArea.Width - Me.Width, y))
Me.y -= 50
Threading.Thread.Sleep(50)
End While
End Sub
Private Sub _hide()
While Me.Location.Y <= My.Computer.Screen.WorkingArea.Height + Me.Height - 50
Me.SetLocation(New Point(My.Computer.Screen.WorkingArea.Width - Me.Width, y))
Me.y += 50
Threading.Thread.Sleep(50)
End While
Me._Close()
End Sub
End Class
-
The Following 6 Users Say Thank You to uncopyable For This Useful Post:
-
18.10.2012, 22:34 #2
- Registriert seit
- 19.11.2011
- Beiträge
- 2.128
Thanked 1.936 Times in 1.180 PostsAW: [VB.Net] Antivir einblendeffekt
Bei mir schlägt das Fehl, denn ich hab die Taskleiste oben und da wird dann auch das echte AntiVir Fenster angezeigt.
Das müsste man bei dem Code noch prüfen und jenachdem oben oder unten Anzeigen weil sonst ist das fail.
-
19.10.2012, 12:22 #3
-
The Following User Says Thank You to iToxic For This Useful Post:
Dbzfreak1337 (19.10.2012)
-
19.10.2012, 12:57 #4
- Registriert seit
- 19.11.2011
- Beiträge
- 2.128
Thanked 1.936 Times in 1.180 PostsAW: [VB.Net] Antivir einblendeffekt
Das seh ich auch. Ich werde die Verbesserungsvorschläge demnächst stillschweigend für mich behalten.
-
19.10.2012, 13:35 #5
AW: [VB.Net] Antivir einblendeffekt
Das ist keine Scheiße?
Die Antwort von NightMareG ist einfach nur überflüssig. Das hier ist kein fertiges Programm, was eine Meldung faken soll. Sondern nur ein Code-Beispiel wie man einen Einblendeeffekt macht. Ein Codebeispiel wie man erkennt wo die Taskbar ist, wäre wieder ein anderes Thema.
-
The Following 4 Users Say Thank You to Flo For This Useful Post:
Dbzfreak1337 (19.10.2012), Gangstersheep (19.10.2012), iToxic (19.10.2012), Runix (19.10.2012)
-
19.10.2012, 16:52 #6
AW: [VB.Net] Antivir einblendeffekt
Flo und iToxic hab ja schon alles notige gesagt.
Hier der Code um die Taskbar Location herauszufinden.
PHP-Code:Public Enum Location
Top
Bottom
Left
Right
End Enum
Public Function GetTaskbarLocation() As Location
Dim bounds As Rectangle = Screen.PrimaryScreen.Bounds
Dim working As Rectangle = Screen.PrimaryScreen.WorkingArea
If working.Height < bounds.Height And working.Y > 0 Then
Return Location.Top
ElseIf working.Height < bounds.Height And working.Y = 0 Then
Return Location.Bottom
ElseIf working.Width < bounds.Width And working.X > 0 Then
Return Location.Left
ElseIf working.Width < bounds.Width And working.X = 0 Then
Return Location.Right
Else
Return Nothing
End If
End Function
Quelle :http://social.msdn.microsoft.com
Sollte ja kein Problem sein das in meine Klasse einzubauen.
-
19.10.2012, 19:33 #7
- Registriert seit
- 19.11.2011
- Beiträge
- 2.128
Thanked 1.936 Times in 1.180 PostsAW: [VB.Net] Antivir einblendeffekt
Code:Public Enum Locationn As Integer Top = 0 Bottom = 1 Left = 2 Right = 3 Undefinded = 4 End Enum Public Function GetTaskbarLocation() As Locationn Dim bounds As Rectangle = Screen.PrimaryScreen.Bounds Dim working As Rectangle = Screen.PrimaryScreen.WorkingArea Dim LocPos As Locationn = Locationn.Undefinded Select Case True Case working.Height < bounds.Height And working.Y > 0 LocPos = Locationn.Top Case working.Height < bounds.Height And working.Y = 0 LocPos = Locationn.Bottom Case working.Width < bounds.Width And working.X > 0 LocPos = Locationn.Left Case working.Width < bounds.Width And working.X = 0 LocPos = Locationn.Right End Select Return LocPos End Function
Naja ist ja nur ein Effekt und der reicht auch für normales Einblenden.
Für Trojanerfakes aber ungeeignet.
-
19.10.2012, 19:35 #8
Ähnliche Themen
-
50€ Virus (Avast Antivir und Microsoft) wegbekommen
Von 5P33D-M0U53 im Forum SecurityAntworten: 9Letzter Beitrag: 13.02.2012, 18:12 -
avast! oder AntiVir?
Von Cube!X im Forum WindowsAntworten: 1Letzter Beitrag: 22.01.2012, 14:17
Diese Seite nutzt Cookies, um das Nutzererlebnis zu verbessern. Klicken Sie hier, um das Cookie-Tracking zu deaktivieren.