Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
SendKeys.Send(TextBox1.Text())
SendKeys.Send("{ENTER}")
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.F4)
stophotkey = GetAsyncKeyState(Keys.F5)
If starthotkey = True Then
'Start
Timer1.Enabled = True
End If
If stophotkey = True Then
'Stop
Timer1.Enabled = False
End If
End Sub
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
and no any errors but when i debuge it gave me erorr on starthotkey = GetAsyncKeyState(Keys.F4)
help me please