Auto clicker dur ikke
Hej jeg prøver at lave en auto clicker der trykker så længe man holder left mouse nedeher er min kode:Imports System.Windows.Forms
Imports System.Runtime.InteropServices
Imports WindowsHook
Public Class Form1
Dim WithEvents gmh As New MouseHook
Declare Sub mouse_event Lib "user64" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Me.gmh.Dispose()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.gmh.InstallHook()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Autoclick()
End Sub
Private Sub Autoclick()
mouse_event(&H2, 0, 0, 0, 1)
mouse_event(&H4, 0, 0, 0, 1)
End Sub
Private Sub MouseHook1_MouseDown(ByVal sender As Object, ByVal e As WindowsHook.MouseEventArgs) Handles MouseHook1.MouseDown
Timer1.Start()
End Sub
Private Sub MouseHook1_MouseUp(ByVal sender As Object, ByVal e As WindowsHook.MouseEventArgs) Handles MouseHook1.MouseUp
Timer1.Stop()
End Sub
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
TextBox1.Enabled = False
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Timer1.Interval = TextBox1.Text
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Enabled = True
End Sub
End Class
Jeg ved ikke hvad der er galt har både prøvet user32 og user64 mne ingen af dem dur jeg bruger også WindowsHookLib her http://www.vbforums.com/showthread.php?t=436321&highlight=mousehook men kan bare ikke finde ud af hvad der er galt har fundet tonvis a guider men ingen til bare at holde left mouse nede på forhånd tak :)