Is it possible to call a UWP Runtime Component from a Win32 app? I'm trying to do this in VS 2019 and I get an error message that the "two projects target different platforms" when trying to add a reference to the UWP component.
I'm wondering what platforms it's talking about or maybe if the error is similar to this issue:
I want to create a Launcher to open various media and folders. I have used ShellExecute in Win32, but that isn't allowed in Store apps. I've tried using Projected namespaces in C++ code, but that is wrought with problems, including certain calls that seem impossible to do. It would be much simpler to call a native UWP/C# interface.
Thanks.
I want to create a Launcher to open various media and folders. I have used ShellExecute in Win32, but that isn't allowed in Store apps.
Are you writing a pure UWP app, or a Win32 app? ShellExecute is allowed for a Win32 app even if it's submitted to Microsoft Store. You should be able to use it without issue.
Thanks. I'm writing a Win32 app. As you pointed out, I was mistaken about store apps. The issue is with S Mode, which I would also like to target. When I run the app certification kit, it says that:
contains a reference to a "Launch Process" related API shell32.dll!ShellExecuteW
Impact if not fixed: Launching executable files is restricted on Windows 10 S systems. Apps that rely on this capability might not run correctly on Windows 10 S systems.
I could rewrite the app in UWP, but I prefer Win32 for various reasons. I would like to see if I could get Projection working in Win32 apps. So far no luck.
Thanks.
@andreww-msft, does your team support shell-execute in S mode?
@OmarJay1 That's just a warning telling you it may failed to launch an exe in S Mode.
Thanks everybody. I think what I have to do is post a beta to the store and test to see what works and what doesn't work. There's an S Mode boot method that I tried, but that won't side load apps, so I think I need to try it from the store.
Thanks.
I tested the app with the S Mode policy simulator, and the ShellExecute calls work. Thanks everybody for your help. I would have otherwise spent the next week trying to get UWP Launcher to work from Win32, and probably failed.
I'll close this issue unless anybody has anything else to say.
Thank you.