
im using VB 2008 to make a autoclicker , and adding hotkeys . [ getasynckeystate ]
however, there is a problem . whenever i debug, an error will appear, saying
EntryPointNotFoundException was unhandled
"Unable to find an entry point named "getasynckeystate" in DLL "user32"
here is the error preview :

here is my code :
Code: Select all
Public Class Form1
Private Declare Function getasynckeystate Lib "user32" (ByVal vkey As Long) As Integer
Declare Sub mouse_event Lib "user32" 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_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub MyMethod()
Windows.Forms.Cursor.Position = New System.Drawing.Point(Windows.Forms.Cursor.Position) 'Draws the point, there my cusor is m
mouse_event(&H2, 0, 0, 0, 1) 'Cursor will go down (like a click)
mouse_event(&H4, 0, 0, 0, 1) 'Cursor goes up again
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox1.Text = TextBox1.Text + 1
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
MyMethod()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
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 Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim starthotkey As Boolean
Dim stophotkey As Boolean
starthotkey = getasynckeystate(Keys.F5)
stophotkey = getasynckeystate(Keys.F6)
If starthotkey = True Then
Timer1.Start()
End If
If stophotkey = True Then
Timer1.Stop()
End If
End Sub
End Class
thanks to anyone who helps me
