Calling "Windows.UI" namespace from Unity / create windows plugin

Hi all,

My experience is in the mobile field, so not sure how to create a plugin for windows.

the functionality I need to achieve: [Disable taking screenshots] same as in Android apps.

I found that I can do that if I called the following function:

Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().IsScreenCaptureEnabled = false;

as I am using a Mac device, I only have the option to create a standalone version for windows, not UWP

not sure if it is an easy task, and it is just me that don’t know how, or it is harder than I can expect

Thanks in advance

That API will not work for non-UWP applications. ApplicationView.GetForCurrentView() will just return null.

so if I am building for UWP version, I will be able to do that call true ?

Great, Thanks for telling me that, will try it on a windows Machine ASAP

Yes, that will work on UWP apps. You just need to surround it in an #ifdef:

#if ENABLE_WINMD_SUPPORT && UNITY_WSA
Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().IsScreenCaptureEnabled = false;
#endif