启动后如何杀死tabtip进程

时间:2016-07-28 11:15:36

标签: vb.net process kill

我可以在我的程序中启动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()行上,我收到此错误:

  

无法处理请求,因为进程(5312)已退出。

1 个答案:

答案 0 :(得分:0)

我明白了:

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