2016-07-28 37 views
0

我可以在我的程序中啓動tabtip(虛擬鍵盤),但由於某種原因,我無法殺死它。如何在啓動後殺死tabtip進程

這是我的代碼:

Private tabtipProcess As Process 

Private Sub t_Enter(sender As Object, e As EventArgs) 
    tabtipProcess = Process.Start("tabtip") 
End Sub 

Private Sub t_Leave(sender As Object, e As EventArgs) 
    tabtipProcess.Kill() 
End Sub 

上線tabtipProcess.Kill()我得到這個錯誤:

Cannot process request because the process (5312) has exited.

+0

請不要嘗試格式化問題正確。請參閱編寫問題時顯示的_「如何格式化」框。我現在修好了。 –

+0

[如何關閉TextInputPanel]的可能重複(http://stackoverflow.com/questions/15148740/how-to-close-textinputpanel) – topshot

回答

0

心中已經明白了:

For Each pkiller As Process In Process.GetProcesses 
     If String.Compare(pkiller.ProcessName, "tabtip", True) = 0 Then 
      pkiller.Kill() 
     End If 
    Next