Page 1 of 1

[Help] -VB08 AutoClicker-

Posted: Sun May 16, 2010 2:09 pm
by Chance
Hello , people :D
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 :
Image

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 :)

Re: [Help] -VB08 AutoClicker-

Posted: Tue Jun 08, 2010 10:26 am
by NoobHacker
your code is weird,look at mine

Code: Select all

dim starthotkey as integer = keys.f5
dim stophotkey as integer = key.f6
if getasynckeystate(starthotkey) then 'if u wan add = true also can
timer1.start
elseif getasynckeystate(stophotkey) then
timer1.stop
end if