How to call the soft keyboard under the tablet Windows program

Source: Internet
Author: User



Http://stackoverflow.com/questions/21140852/start-tabtip-with-numpad-view-open  [dllimport ("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]        Private STA TIC extern bool PostMessage (IntPtr hWnd, uint MSG, IntPtr WParam, IntPtr lParam);        [DllImport ("U Ser32.dll ", SetLastError = true, CharSet = CharSet.Auto)]        private static extern IntPtr Findwind ow (String lpclassname, String lpwindowname);          private static void Killtabtip () & nbsp       {           //Kill the previous process so the registry change would t Ake effect.            var processlist = process.getprocesses ();       & nbsp     foreach (Var process in processlist. Where (Process = process. ProcessName = = "Tabtip")             {              &NBSP ; Process. Kill ();            &NBSp   break;           }       }         Pub Lic static void Showtouchkeyboard (bool isVisible, BOOL Numerickeyboard)         {      & nbsp     if (isVisible)             {              &N Bsp Const string keyName = "hkey_current_user\\software\\microsoft\\tablettip\\1.7";                 var regvalue = (int) registry.getvalue (keyName, "Keyboardlayoutpreference", 0);    & nbsp           var regshownumerickeyboard = Regvalue = 1;           &NB Sp    //Note:remove this if does not want to control docked state.                var dockedregvalue = (int) registry.getvalue (keyName, "Edgetargetdockedstate", 1);        &NBS P       var restoredockedstate = Dockedregvalue = = 0;                 if (Numerickeyboard && Regshownumerickeyboard = false)                 {&N Bsp                  //Set the registry so it'll show the number pad via the Thumb keyboard.                    Registry.setvalue (KeyName, "keyboardl Ayoutpreference ", 1, Registryvaluekind.dword);                     Kill the previous process so the registry change would take effect.              &NB Sp     Killtabtip ();               }          &NB Sp     ELSE if (Numerickeyboard = = False && Regshownumerickeyboard)           &NBSP ;   &NBSp {                   //Set the registry so it won't show the number Pad via the thumb keyboard.                    Registry.setvalue (keyName , "Keyboardlayoutpreference", 0, Registryvaluekind.dword);                 & nbsp  /Kill The previous process so the registry change would take effect.            &NBS P       Killtabtip ();               }       &NBS P        //Note:remove this if does not want to control docked state.                if (restoredockedstate)                 {                   //Set the registry so it'll show as docked at the bottom rather than Floating.                    Registry.setvalue (keyName, "Edgetargetdockedstate", 1, Registryvaluekind.dword);                    //Kill the Previ OUs process so the registry change would take effect.                    Killtabtip ();               }             &NBS P   Process.Start ("C:\\Program Files\\Common Files\\Microsoft Shared\\ink\\tabtip.exe");           }            else            {  &nbs P             var win8version = new Version (6, 2, 9200, 0);         & nbsp       if (Environment.OSVersion.Version >= win8version)                 {    &nbsp               const int wmsyscommand = 274;            &N Bsp       const UINT SCCLOSE = 61536;                    INTP TR Keyboardwnd = FindWindow ("Iptip_main_window", null);                  &NBS P PostMessage (Keyboardwnd, Wmsyscommand, (int) scclose, 0);               }  &N Bsp        }       } 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.