Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.physics > #696295

Kill&ReStart the "touch keyboard" before bringing it "up" ( on screen ).

From Jeff-Relf.Me @.
Message-ID <Jeff-Relf.Me@Jul.30--6.15am.Seattle.2018> (permalink)
References (6 earlier) <Jeff-Relf.Me@Jul.22--10.17am.Seattle.2018> <Jeff-Relf.Me@Jul.23--3.12am.Seattle.2018> <Jeff-Relf.Me@Jul.23--4.34pm.Seattle.2018> <Jeff-Relf.Me@Jul.25--5.48am.Seattle.2018> <Jeff-Relf.Me@Jul.28--0.31pm.Seattle.2018>
Newsgroups comp.os.linux.advocacy, sci.physics, alt.comp.os.windows-10, news.software.readers, comp.lang.c++, alt.checkmate
Subject Kill&ReStart the "touch keyboard" before bringing it "up" ( on screen ).
Organization usenet-news.net
Date 2018-07-30 06:15 -0700

Cross-posted to 6 groups.

Show all headers | View raw


https://stackoverflow.com/a/51376030/5732431

In Win10 Ver 1803, DesktopMode, there is no reliable way to  
toggle the "Touch Keyboard" on|off [ ITipInvocation.Toggle() ];  
nor can you _reliably_ discover if it's "up" ( on screen )  
[ IFrameworkInputPane.Location() ]; both routines fail _randomly_.  

Instead, ensure that "TabTIP.EXE" and "....InputApp.EXE"  
only run when the keyboard is "up" ( on screen ).  

To toggle the keyboard on and off ( from X.CPP in Jeff-Relf.Me/X.ZIP ):  

    if ( WM == WM_HOTKEY && C == 'K' ) {
    
      //  A mouse button takes me here.  Jeff-Relf.Me/g600.PNG
    
      if ( KillProc = 1, Running( L"TabTIP.EXE" ), KillProc = 1, Running( 
          L"WindowsInternal.ComposableShell.Experiences.TextInput.InputApp.EXE"
      ) )  

        //  The keyboard was _On_ ( i.e. its processes were running ), 
        //  so it was "turned _Off_" (killed); and we're done.

        goto Done ;
    
      //  The keyboard was _Off_ ( i.e. no running processes ). 
      //  Turn it _On_: 
    
      Launch( L"%CommonProgramFiles%/microsoft shared/ink/TabTIP.EXE" );
      Sleep(99);

      static const GUID CLSID_UIHostNoLaunch = {  0x4CE576FA, 0x83DC,
        0x4f88,  0x95, 0x1C, 0x9D, 0x07, 0x82, 0xB4, 0xE3, 0x76 };
      static const GUID IID_ITipInvocation = {  0x37c994e7, 0x432b,
        0x4834, 0xa2, 0xf7, 0xdc, 0xe1, 0xf1, 0x3b, 0x83, 0x4b };
      static struct ITipInvocation : IUnknown {  virtual HRESULT 
        STDMETHODCALLTYPE  Toggle( HWND wnd ) = 0 ;  }  * Tog ;
    
      Tog = 0, CoCreateInstance( CLSID_UIHostNoLaunch, 0, CLSCTX_INPROC_HANDLER
        | CLSCTX_LOCAL_SERVER, IID_ITipInvocation, (void**) & Tog );
    
      //  Firefox and Chrome need this: 
    
      Tog ? Tog->Toggle( GetDesktopWindow() ), Tog->Release() : 0 ;    }
    - - - - - - - - - - - - -
    //  To get the process list, and kill stuff: 
    #include <tlhelp32.H>
    
          int  KillProc ;
    int Running( wchar * EXE ) {  int  Found ;  HANDLE  PIDs, aProc ;
      PROCESSENTRY32  aPID = { sizeof aPID };
      PIDs = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
      Process32First( PIDs, &aPID );
      while ( Found = !strCmpI( aPID.szExeFile, EXE ),
        KillProc && Found && ( 
          aProc = OpenProcess( PROCESS_TERMINATE, 0, aPID.th32ProcessID ),
          aProc ? TerminateProcess( aProc, 9 ), CloseHandle( aProc ) : 0 ),
        !Found && Process32Next( PIDs, &aPID ) );
      
      KillProc = 0, CloseHandle( PIDs );  return  Found ;   }
    
    
    Launch( wchar * Cmd ) {  wchar _Cmd[333];  static PROCESS_INFORMATION Stat ;
      static STARTUPINFO SU = { sizeof SU };
      SetEnvironmentVariable( L"__compat_layer", L"RunAsInvoker" );
      ExpandEnvironmentStrings( Cmd, _Cmd, 333 ), Cmd = _Cmd ;
      if ( CreateProcess( 0, Cmd, 0,0,1,0,0,0, &SU , &Stat ) )
        CloseHandle( Stat.hProcess ), CloseHandle( Stat.hThread );  }
    
    //  CoInitialize(0);

Back to sci.physics | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Toggling "Touch Keyboard" On/Off, Firefox and Chrome. Jeff-Relf.Me  @. - 2018-07-10 13:52 -0700
  Re: Toggling "Touch Keyboard" On/Off, Firefox and Chrome. % <persent@gmail.com> - 2018-07-10 13:56 -0700
  ReKilling Cortana zombies. Jeff-Relf.Me  @. - 2018-07-13 01:47 -0700
  Re: Toggling "Touch Keyboard" On/Off, Firefox and Chrome. Storage Unit <storage.unit@mailinator.com> - 2018-07-15 22:01 -0500
    As I get older, I give fewer and fewer fucks. Jeff-Relf.Me  @. - 2018-07-15 22:09 -0700
      If the keyboard doesn't come up right away. Jeff-Relf.Me  @. - 2018-07-16 06:12 -0700
        ITipInvocation.Toggle() fails BIG TIME if it's called more than once a second. Jeff-Relf.Me  @. - 2018-07-23 03:12 -0700
          I'm narrowing it down, hopefully. Jeff-Relf.Me  @. - 2018-07-23 16:34 -0700
            InputApp and TabTIP are _always_ killed. Jeff-Relf.Me  @. - 2018-07-25 05:48 -0700
              Kill&ReStart the "touch keyboard" before bringing it "up" ( on screen ). Jeff-Relf.Me  @. - 2018-07-28 12:31 -0700
                Kill&ReStart the "touch keyboard" before bringing it "up" ( on screen ). Jeff-Relf.Me  @. - 2018-07-30 06:15 -0700
        Re: Another fail, another post... "Colonel Edmund J. Burke" <burkesbabes@bigass-babes.com> - 2018-07-25 07:00 -0700
    Re: Toggling "Touch Keyboard" On/Off, Firefox and Chrome. Lewis <g.kreme@gmail.com.dontsendmecopies> - 2018-07-16 16:05 +0000
      Re: Toggling "Touch Keyboard" On/Off, Firefox and Chrome. Paavo Helde <myfirstname@osa.pri.ee> - 2018-07-16 19:31 +0300
      Switch SysFolders to Short, Friendly Paths, all under "C:\__" ( Home ). Jeff-Relf.Me  @. - 2018-07-16 10:15 -0700
      Re: Toggling "Touch Keyboard" On/Off, Firefox and Chrome. Storage Unit <storage.unit@mailinator.com> - 2018-07-17 05:32 -0500
        Re: Toggling "Touch Keyboard" On/Off, Firefox and Chrome. % <Persent@gmail.com> - 2018-07-18 06:23 -0700
  Re: Toggling "Touch Keyboard" On/Off, Firefox and Chrome. "reber G=emc^2" <herbertglazier0@gmail.com> - 2018-07-22 10:43 -0700
    Re: Toggling "Touch Keyboard" On/Off, Firefox and Chrome. "hanson" <hanson@quick.net> - 2018-07-22 11:06 -0700
    You can convert your speech into text, instead of typing. Jeff-Relf.Me  @. - 2018-07-22 11:48 -0700
      Re: You can convert your speech into text, instead of typing. Double-A <double-a3@hush.com> - 2018-07-22 16:22 -0700
  Re: Toggling "Touch Keyboard" On/Off, Firefox and Chrome. "reber G=emc^2" <herbertglazier0@gmail.com> - 2018-07-31 19:46 -0700
    NewsPapers and HandWritten letters are still good; just not as good. Jeff-Relf.Me  @. - 2018-07-31 20:18 -0700

csiph-web