How to prevent user form record video and audio?

-4

I'm writing a media player with C# WPF. I want to block the Screen recorder so user can not capture my content. I use this code for solve this problem: How to use SetWindowDisplayAffinity

[DllImport("user32.dll")]
    public static extern uint SetWindowDisplayAffinity(IntPtr hwnd, uint dwAffinity);
     /////////////  
    const uint WDA_MONITOR = 0x00000001;  
    IntPtr windowHandle = new WindowInteropHelper(Application.Current.MainWindow).Handle;
    SetWindowDisplayAffinity(windowHandle, WDA_MONITOR);

This code does work and the video not recorded, but audio still is captured.

How can prevent the recorder program to capture audio too? Or how can pause or stop my player when that code detected the recorder?

c#
wpf
mediaelement
recorder
asked on Stack Overflow Nov 10, 2020 by link • edited Nov 11, 2020 by link

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0