Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short
Module Module1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Short
Public Sub HotKey(ByVal hotkey As Boolean)
HotKey = GetAsyncKeyState(Keys.Insert) 'Change to any hotkey
If hotkey = True Then
'Do something
'add your code here when the hotkey is pressed
End If
End Sub
End Module
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Int16


Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Int16
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 Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Timer2.Enabled = True
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Timer2.Enabled = False
End Sub
Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Timer1.Interval = Convert.ToInt32(TextBox2.Text)
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Timer1.Interval = Convert.ToInt32(TextBox1.Text)
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}")
HotKey(True)
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
SendKeys.Send(TextBox2.Text)
SendKeys.Send("{Enter}")
End Sub
Private Sub ComboBox1_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Timer1.Interval = Convert.ToInt32(TextBox2.Text)
End Sub
Private Sub ComboBox2_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
Timer1.Interval = Convert.ToInt32(TextBox1.Text)
End Sub
Private Sub TabPage1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabPage1.Click
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Module Module1
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Short
Public Sub HotKey(ByVal hotkey As Boolean)
hotkey = GetAsyncKeyState(Keys.F7) 'Change to any hotkey
If hotkey = True Then
End If
End Sub
End Module
Timer1.Interval = Val(Textbox1.Text)
Timer1.Interval = Convert.ToInt32(TextBox2.Text)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.enabled = false
Timer2.enabled = false
End Sub
Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Int16
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer2.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer2.Enabled = False
End Sub
Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Timer1.Interval = Val(TextBox2.Text)
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Timer1.Interval = Val(TextBox1.Text)
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim f7 as boolean
f7 = getasynckeystate(key.f7)
if f7 = true then
if timer2.enabled = false then
timer2.enabled = true
else
timer2.enabled = false
end if
end if
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
SendKeys.Send(TextBox2.Text)
SendKeys.Send("{Enter}")
End Sub
Private Sub ComboBox1_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Timer1.Interval = Val(TextBox2.Text)
End Sub
Private Sub ComboBox2_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
Timer1.Interval = Val(TextBox1.Text)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.enabled = true
timer2.enabled = false
End Sub
End Class