Search code examples
c#uwpdesktop-bridge

How to launch WindowsInternal.ComposableShell.Experiences.TextInput.InputApp


I want to launch WindowsInternal.ComposableShell.Experiences.TextInput.InputApp located in C:\Windows\SystemApps\InputApp_cw5n1h2txyewy. To be clear, I don't want to display the touch-keyboard, I just need this particular process to be running. Is there a way to achieve that? Using .NET extensions is acceptable, but not preferred.

I want to do this to add a StateChangedWatcher at startup, but the process does not yet exist at startup and needs to be started manually for this to work right now. Also, addding this to startup manually does not launch it, neither does simply trying to execute this. Are there any parameters it needs to be launched with?


Solution

  • To be clear, I don't want to display the touch-keyboard, I just need this particular process to be running. Is there a way to achieve that?

    You will find AppxManifest.xml in the C:\Windows\SystemApps\InputApp_cw5n1h2txyewy folder. And there is windows.protocol name in it. In other words, you could launch it with Windows.System.Launcher

    <uap:Extension Category="windows.protocol">
      <uap:Protocol Name="ms-inputapp" DesiredView="useMinimum">
        <uap:DisplayName>Input App</uap:DisplayName>
      </uap:Protocol>
    </uap:Extension>
    

    Usage

    private async void Button_Click(object sender, RoutedEventArgs e)
    {
        var options = new Windows.System.LauncherOptions();
        options.DesiredRemainingView = Windows.UI.ViewManagement.ViewSizePreference.UseMinimum;
        var success = await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-inputapp:"), options);
    }