2013-02-07 76 views
5

我需要关闭Windows 8(桌面winform.net)下的程序的tabtip键盘。 我发现需要时打开它,运行TabTip.exe来显示Windows 8 Touch键盘,但当我需要时我无法关闭它! 我试图用process.kill杀死进程,但它不起作用,有人有一个想法如何做到这一点?打开和关闭桌面下的Windows 8触摸键盘tabtip

问候 让 - 克洛德·

+0

你发现了吗?我有同样的问题。 –

+0

没有找到,抱歉。我正在开发一个类似于Windows 8中的WinForm键盘,我使用了Microsoft键盘示例。 – jcq

+0

我想通了,并在这里回答我自己的问题http://stackoverflow.com/questions/15148740/how-to-close-textinputpanel –

回答

0

尝试如下─与TabTip更换奥斯克

公共类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 

末级

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