I'm currently using Visual Basic 2010:
I would like to create an Auto Typer with Hot Keys. The purpose for these hot keys would be even when minimized, so when playing a video game or typing into a website chat I may type "F12" and it will send whatever message I have preset without having to un-minimize the program I've made!
Below is what I have got so far, I'd appreciate some help.
Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Int32) _
As Short
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If GetAsyncKeyState(Keys.F12) Then Button1.PerformClick()
SendKeys.Send(TextBox1.Text)
SendKeys.Send("{Enter}")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Then
MsgBox("The message box was left blank!", MsgBoxStyle.Exclamation)
Timer1.Stop()
Else
Timer1.Interval = TextBox2.Text * 1000
Timer1.Start()
Me.WindowState = FormWindowState.Minimized
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Stop()
End Sub
End Class