在桌面下打开和关闭Windows 8触摸键盘tabtip

时间:2013-02-07 07:55:52

标签: .net windows keyboard

我需要从Windows 8(桌面winform .NET)下的程序关闭tabtip键盘。 我发现需要时打开它,运行TabTip.exe来显示Windows 8 Touch键盘,但我无法在需要时关闭它! 我试图用process.kill杀死进程,但它不起作用,有人知道该怎么做?

此致 吉恩克劳德

3 个答案:

答案 0 :(得分:3)

Tabtip.exe打开,然后再次关闭之前产生两个进程。因此,process.kill命令不起作用,因为原始进程已经关闭。

查看所有打开的进程并关闭任何与tabtip相关的内容。

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

答案 1 :(得分:0)

尝试以下内容 - 使用TabTip替换Osk

Public Class Form1

Private oskProcess As Process

Private Sub openButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles openButton.Click
    If Me.oskProcess Is Nothing OrElse Me.oskProcess.HasExited Then
        If Me.oskProcess IsNot Nothing AndAlso Me.oskProcess.HasExited Then
            Me.oskProcess.Close()
        End If

        Me.oskProcess = Process.Start("osk")
    End If
End Sub

Private Sub closeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles closeButton.Click
    If Me.oskProcess IsNot Nothing Then
        If Not Me.oskProcess.HasExited Then
            'CloseMainWindow would generally be preferred but the OSK doesn't respond.
            Me.oskProcess.Kill()
        End If

        Me.oskProcess.Close()
        Me.oskProcess = Nothing
    End If
End Sub

结束班

答案 2 :(得分:0)

我发现了一个未记录的COM接口,用于控制屏幕键盘。查看我的其他答案以获取详细信息https://stackoverflow.com/a/40921638/332528