im working on a mouse recorder.. but it will not play the co-ordinates or clicks that i recorded. can somebody tell me what i done wrong or if there is other codes i can use and what they are?
My current codes:
::::Codes for recording::::Code:Public Class Form1 Dim result As Integer Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer) Private Const MOUSEEVENTF_ABSOLUTE = &H8000 ' absolute move Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down Private Const MOUSEEVENTF_LEFTUP = &H4 ' left button up Private Const MOUSEEVENTF_MOVE = &H1 ' mouse move Private Const MOUSEEVENTF_MIDDLEDOWN = &H20 Private Const MOUSEEVENTF_MIDDLEUP = &H40 Private Const MOUSEEVENTF_RIGHTDOWN = &H8 Private Const MOUSEEVENTF_RIGHTUP = &H10
::::Codes for playing::::Code:Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim Mouse As Point = Control.MousePosition If GetAsyncKeyState(MOUSEEVENTF_LEFTDOWN) Then ListBox1.Items.Add("Left") End If If GetAsyncKeyState(MOUSEEVENTF_RIGHTDOWN) Then ListBox1.Items.Add("Right") End If ListBox1.Items.Add(Mouse.X & "," & Mouse.Y) End Sub
Please Help me with this.. i really need to get this to workCode:Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick If ListBox1.Text = "Left" Then mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0) ElseIf ListBox1.Text = "Right" Then mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0) ElseIf ListBox1.SelectedIndex = ListBox1.SelectedIndex + +1 Then Else MsgBox("A Problem Has Occured") End If End Sub




Reply With Quote