0
votes

I've been searching and still can't find answers about this problem. i had managed to open the process of the tab tip by this code:

Private Sub TextBox1_GotFocus(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles TextBox1.GotFocus

Process.Start("C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe")

End Sub

ive been trying to kill the process but still it won't work.

But returning it to dock or closed. still can't find any answers.Is this possible? hope someone cud help. thanks! :)

2

2 Answers

3
votes
/// <summary>
/// Close Touch Keyboard
/// </summary>
public static void CloseTouchKeyboard()
{
    try
    {
        foreach (var p in Process.GetProcessesByName("C:\\Program Files\\Common Files\\microsoft shared\\ink\\TabTip.exe"))
        {
            p.Kill();
        }
    }
    catch (Exception e)
    {
        Logger.Error(e.ToString());
    }
}

/// <summary>
/// Open Touch keyboard
/// </summary>
public static void OpenTouchKeyboard()
{
    try
    {
        Process.Start("C:\\Program Files\\Common Files\\microsoft shared\\ink\\TabTip.exe");
    }
    catch (Exception e)
    {
        Logger.Error(e.ToString());
    }
}
1
votes

The Process.Close, CloseMainWindow, etc did not work for me, so send this message to close the keyboard.

[DllImport("user32.dll")]
public static extern IntPtr FindWindow(String sClassName, String sAppName);

int WM_SYSCOMMAND = 274
uint SC_CLOSE   = 61536
...

IntPtr KeyboardWnd = FindWindow("IPTip_Main_Window", null);
PostMessage(KeyboardWnd , WM_SYSCOMMAND, SC_CLOSE, 0);

Thanks to http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/de9b66b5-f1e2-477c-9da2-303982790f63/ for the answer!