The following is the calling code:
Private Const INT32 Wm_syscommand = 274;private Const UInt32 sc_close = 61536; [DllImport ("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]private static extern bool PostMessage (IntPtr hWnd, int MSG, int wParam, int lParam); [DllImport ("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]private static extern bool PostMessage (IntPtr hWnd, int MSG, uint wParam, uint lParam); [DllImport ("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]private static extern bool PostMessage (IntPtr hWnd, UINT MSG, IntPtr WParam, IntPtr lParam); [DllImport ("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]private static extern IntPtr FindWindow (String LPCL Assname, string lpwindowname); [DllImport ("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]private static extern int RegisterWindowMessage ( String lpstring); Display on-screen keyboard public static int Showinputpanel () {try {dynamic file = "C:\\Program Files\\Common Files\\mi Crosoft Shared\\ink\\tabtip.exe "; if (! System.IO.File.Exists (File)) return-1; Process.Start (file); return Setundock (); I do not know what the Setundock () is, so the direct comment returns 1 return 1; } catch (Exception) {return 255; }}//Hidden on-screen keyboard public static void Hideinputpanel () {IntPtr Touchhwnd = new IntPtr (0); Touchhwnd = FindWindow ("Iptip_main_window", null); if (Touchhwnd = = IntPtr.Zero) return; PostMessage (Touchhwnd, Wm_syscommand, sc_close, 0);}
Windows system also has a OSK virtual keyboard, this is floating, and automatically eject the keyboard a bit different, if necessary, can also be called directly.
Process.Start (@ "C:\windows\system32\osk.exe");
C # calls a virtual keyboard that comes with Windows (8/10)