确定 C++ 应用程序是否在 Desktop Bridge 中作为 UWP 应用程序运行(Project Centennial)

2021-12-28 00:00:00 winapi c++ uwp desktop-bridge

我已将 C++/Win32 应用程序打包为 appx 并且运行正常.但是,由于某些路径不可用,我必须以某种方式确定应用程序是否作为打包的 UWP 应用程序运行并进行调整.

I've packaged a C++/Win32 application as an appx and it runs OK. However, since some paths are unavailable I must somehow determine if the application is running as a packaged UWP application and adapt.

是否可以通过简单的运行时检查来确定您是否作为打包的 UWP 应用程序运行?

Is there a simple runtime check one can do to determine if you are running as a packaged UWP application?

推荐答案

是否可以通过简单的运行时检查来确定您是否作为打包的 UWP 应用程序运行?

Is there a simple runtime check one can do to determine if you are running as a packaged UWP application?

是的,您可以通过 GetPackageFamilyName 函数

未打包返回值APPMODEL_ERROR_NO_PACKAGE.

相关文章