Public Class Form1
Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Const KEYEVENTF_EXTENDEDKEY = &H1
Const KEYEVENTF_KEYUP = &H2
Declare Auto Sub mouse_event Lib "user32.dll" (ByVal dwFlags As Int32, ByVal dx As Int32, ByVal dy As Int32, ByVal cButtons As Int32, ByVal dwExtraInfo As IntPtr)
Dim pixel As Integer = 5
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If GetAsyncKeyState(Keys.Down) And My.Computer.Keyboard.AltKeyDown = True Then
Dim x As Integer = Cursor.Position.X
Dim y As Integer = Cursor.Position.Y
Cursor.Position = New Point(x, y + pixel)
End If
If GetAsyncKeyState(Keys.Up) And My.Computer.Keyboard.AltKeyDown = True Then
Dim x As Integer = Cursor.Position.X
Dim y As Integer = Cursor.Position.Y
Cursor.Position = New Point(x, y - pixel)
End If
If GetAsyncKeyState(Keys.Left) And My.Computer.Keyboard.AltKeyDown = True Then
Dim x As Integer = Cursor.Position.X
Dim y As Integer = Cursor.Position.Y
Cursor.Position = New Point(x - pixel, y)
End If
If GetAsyncKeyState(Keys.Right) And My.Computer.Keyboard.AltKeyDown = True Then
Dim x As Integer = Cursor.Position.X
Dim y As Integer = Cursor.Position.Y
Cursor.Position = New Point(x + pixel, y)
End If
If GetAsyncKeyState(Keys.Insert) And My.Computer.Keyboard.AltKeyDown = True Then
mouse_event(2, 0, 0, 0, 0)
mouse_event(4, 0, 0, 0, 0)
End If
If GetAsyncKeyState(Keys.Enter) And My.Computer.Keyboard.AltKeyDown = True Then
mouse_event(8, 0, 0, 0, 0)
mouse_event(16, 0, 0, 0, 0)
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = "Risoluzione schermo = " & Screen.PrimaryScreen.WorkingArea.Width & " X " & Screen.PrimaryScreen.WorkingArea.Height
Timer1.Start()
End Sub
Private Sub NumericUpDown1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumericUpDown1.ValueChanged
If NumericUpDown1.Value > 50 Then
NumericUpDown1.Value = 1
Else
pixel = NumericUpDown1.Value
End If
End Sub
Private Sub NotifyIcon1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NotifyIcon1.Click
If Me.Opacity = 0 Then
Me.Opacity = 100
Else
Me.Opacity = 0
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
AboutBox1.ShowDialog()
End Sub
End Class