Junday
September 2nd, 2009, 11:07 AM
Hello out there :-)
I am making a macro program, which should write a text when i click on a specify key on keyboard. I use F keys from F1 to F10 and my program works fine...
The only problem i get is that the F1 key call the Help-box and F2 call the Find-box e.g. but i wanted to know, if its possible on a easy way that would disable them, and only react on send text i wan't without calling these...
I use GetAsyncKeystate Function with Boolean.
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
and my F1 key (Timer Tick) look like this:
Private Sub bindf1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bindf1.Tick
Dim bindf1 As Boolean
bindf1 = GetAsyncKeyState(Keys.F1)
If bindf1 = True Then
SendKeys.Send(F1_txt.Text)
SendKeys.Send("{Enter}")
End If
End Sub
It works great, but the only problem is it calls the HELP-box which i don't want...
Thank you :-)
I am making a macro program, which should write a text when i click on a specify key on keyboard. I use F keys from F1 to F10 and my program works fine...
The only problem i get is that the F1 key call the Help-box and F2 call the Find-box e.g. but i wanted to know, if its possible on a easy way that would disable them, and only react on send text i wan't without calling these...
I use GetAsyncKeystate Function with Boolean.
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
and my F1 key (Timer Tick) look like this:
Private Sub bindf1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bindf1.Tick
Dim bindf1 As Boolean
bindf1 = GetAsyncKeyState(Keys.F1)
If bindf1 = True Then
SendKeys.Send(F1_txt.Text)
SendKeys.Send("{Enter}")
End If
End Sub
It works great, but the only problem is it calls the HELP-box which i don't want...
Thank you :-)