I'm making a WPF application to project desktop screen to a wireless display. But this function is only availabe in UWP, check this Microsoft official sample: https://github.com/microsoft/Windows-universal-samples/tree/main/Samples/Projection/cs
So another way is to call projection function of UWP application from WPF application, two processes coexit. Then the issue is how to hide or minimize UWP window. Due to the projection function ProjectionManager.StartProjectingAsync()
takes something like ApplicationView.GetForCurrentView().Id
as arguments, which is under namespace Windows.UI.ViewManagement
of UWP GUI only (WinRT).
Any idea?
Currently, UWP GUI cannot be started without showing window or splash screen. You can minimize it after opening it.
Of course, after minimizing, you need to execute your API in a backgroundTask, you may need to run it indefinitely.
IList<AppDiagnosticInfo> infos = await AppDiagnosticInfo.RequestInfoForAppAsync();
IList<AppResourceGroupInfo> resourceInfos = infos[0].GetResourceGroups();
await resourceInfos[0].StartSuspendAsync();