首页 > 解决方案 > 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?

标签: c#uwpdesktop-bridge

解决方案


需要明确的是,我不想显示触摸键盘,我只需要运行这个特定的进程。有没有办法做到这一点?

您将AppxManifest.xmlC:\Windows\SystemApps\InputApp_cw5n1h2txyewy文件夹中找到。而且里面有windows.protocol名字。换句话说,你可以启动它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>

用法

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);
}

推荐阅读