
Module module1
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Public Sub HotKey(ByVal hotkey As Boolean)
hotkey = GetAsyncKeyState(Keys.Alt + Keys.S)
If hotkey = True Then
Form1.Timer1.Enabled = True
End If
End Sub
End Module
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
HotKey(True)
SendKeys.Send(TextBox1.Text + "{enter}")
End Sub
Private Sub FButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FButton1.Click
Timer1.Enabled = True
End Sub
Private Sub FButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FButton2.Click
Timer1.Enabled = False
End Sub
End Class
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Int32) As Int16