Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
Dim mythread As New Thread(AddressOf getKey)
mythread.Start()
End Sub
Private Sub getKey()
Dim pressNum As Short
Dim key As Integer
While True
pressNum = GetAsyncKeyState(41) //41 is key 'A'
If pressNum <> 0 Then
Exit While
End If
End While
MsgBox("A")
End Sub