我想使用VB.net创建一个屏幕键盘,将键发送到具有焦点的另一个程序(网页输入)。
我试过这个
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.TopMost = True
End Sub
Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
Get
Const WS_EX_NOACTIVATE As Int32 = &H8000000
Dim cp As CreateParams = MyBase.CreateParams
cp.ExStyle = cp.ExStyle Or WS_EX_NOACTIVATE
Return cp
End Get
End Property
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
SendKeys.Send("A")
End Sub
但是当我呼叫SendKeys
发送到网页输入时,我没有得到任何结果,当我呼叫SendKeys
发送到记事本或开始菜单等其他程序时,我得到一个结果。需要帮助。