如何在启动后杀死tabtip进程

how to kill tabtip process after starting it

我可以在我的程序中启动 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.

我知道了:

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