I\'m writing a WPF application for a Windows 8 tablet. It\'s full windows 8 and not ARM/RT.
When the user enters a textbox I show the on screen keyboard using the fo
I could successfully close onscreen keyboard with the following C# code.
[DllImport("user32.dll")]
public static extern int FindWindow(string lpClassName,string lpWindowName);
[DllImport("user32.dll")]
public static extern int SendMessage(int hWnd, uint Msg, int wParam, int lParam);
public const int WM_SYSCOMMAND = 0x0112;
public const int SC_CLOSE = 0xF060;
private void closeOnscreenKeyboard()
{
// retrieve the handler of the window
int iHandle = FindWindow("IPTIP_Main_Window", "");
if (iHandle > 0)
{
// close the window using API
SendMessage(iHandle, WM_SYSCOMMAND, SC_CLOSE, 0);
}
}
private void Some_Event_Happened(object sender, EventArgs e)
{
// It's time to close the onscreen keyboard.
closeOnscreenKeyboard();
}
I hope this will help you.