windows - 有没有更好的方法从控制台应用程序启动 UWP 应用程序

标签 windows uwp uwp-xaml launcher

我试图从 c# 控制台应用程序启动 UWP 应用程序。它尝试使用以下使用APPID的代码

Process.Start(@"C:\Program Files (x86)\Windows Kits\10\App Certification Kit\microsoft.windows.softwarelogo.appxlauncher.exe", "1a75- 6f75 - 5ed3 - 8944 - 6b7df2bee095");

有没有更好的方法以编程方式启动 UWP 应用程序。

最佳答案

要在系统上启动任何 UWP 应用,您可以使用以下 API:
AppListEntry.LaunchAsync Method

要获取所需应用程序的 AppListEntry,请使用 PackageManager API:
PackageManager.FindPackageForUser(String, String) Method
Package.GetAppListEntriesAsync Method

或者,您可以使用以下 Win32 API 代替 AppListEntry API:
IApplicationActivationManager::ActivateApplication method

关于windows - 有没有更好的方法从控制台应用程序启动 UWP 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56325825/

相关文章:

c# - 如何在 UWP XAML/C# 中更改滚动查看器的滚动量?

java - 从批处理文件启动java可执行文件会产生错误 "Java Virtual Machine Launcher Could not find main class"

windows - 列出在 Windows 上导出的 nfs 共享

c# - 如何将 Unity IoC 容器与 Template10 一起使用?

c++ - WinRT C++ (Win10) 从 SoftwareBitmap/BitmapBuffer 访问字节

c# - 删除 UWP 中的导航缓存

python - 使用异步 (s)ftp 操作连接 GUI 界面

windows - 可以在 Windows 和 Mac OS 上使用的类似 DB 的 Redis 吗?

c# - UWP - 来自不同样式资源字典的引用 StaticResource : Failed to assign to property 'Windows.UI.Xaml.ResourceDictionary.Source'

uwp - 组合框的默认选定索引使我的 UWP 应用程序崩溃