Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Mouse recording...
- Public Class Form1
- 'You Need This Line Of Code... To simulate Mouse Clicks, and Such...
- Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)
- 'Use These latter on in your Application.
- 'mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- 'mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- 'mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0)
- 'mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0)
- 'The API that handles mouse events, like clicking and such.
- Private Const MOUSEEVENTF_LEFTDOWN = &H2
- Private Const MOUSEEVENTF_LEFTUP = &H4
- Private Const MOUSEEVENTF_RIGHTDOWN = &H8
- Private Const MOUSEEVENTF_RIGHTUP = &H10
- Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Int32) As Integer
- Private Const VK_LBUTTON = &H1
- Private Const VK_RBUTTON = &H2
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- ax.Items.Clear()
- ay.Items.Clear()
- theclicking.Items.Clear()
- Timer1.Start()
- End Sub
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- aX.Items.Add(Cursor.Position.X)
- ay.Items.Add(Cursor.Position.Y)
- If (GetAsyncKeyState(1)) Then
- theclicking.Items.Add("LeftClick")
- Else
- theclicking.Items.Add("Nothing")
- End If
- If (GetAsyncKeyState(9)) Then
- theclicking.Items.Add("TabPress")
- Else
- 'Nothing.
- End If
- ax.SelectedIndex = ax.SelectedIndex + 1
- ay.SelectedIndex = ay.SelectedIndex + 1
- theclicking.SelectedIndex = theclicking.SelectedIndex + 1
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- ax.SelectedIndex = 0
- ay.SelectedIndex = 0
- theclicking.SelectedIndex = 0
- Timer2.Start()
- End Sub
- Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
- If ax.SelectedIndex = ax.Items.Count - 1 = True Then
- Timer2.Enabled = False
- Else
- ax.SelectedIndex = ax.SelectedIndex + 1
- ay.SelectedIndex = ay.SelectedIndex + 1
- theclicking.SelectedIndex = theclicking.SelectedIndex + 1
- Cursor.Position = New Point(ax.SelectedItem, ay.SelectedItem)
- If theclicking.SelectedItem = "LeftClick" Then
- mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- ElseIf theclicking.SelectedItem = "Nothing" = True Then
- mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- End If
- If theclicking.SelectedItem = "TabPress" Then
- mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- End If
- End If
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Timer1.Stop()
- End Sub
- Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
- If e.KeyCode = Keys.F1 Then
- Timer2.Stop()
- End If
- End Sub
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- End Sub
- Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
- ax.Items.Clear()
- ay.Items.Clear()
- theclicking.Items.Clear()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement