using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace FIRC
{
public class ScreenShotProtect
{
[DllImport("user32.dll")]
private static extern uint SetWindowDisplayAffinity(IntPtr hwnd, uint dwAffinity);
public bool HasProtect
{
get { return isProtect; }
}
private bool isProtect = false;
public void Protect(IntPtr handle)
{
SetWindowDisplayAffinity(handle, 1);
isProtect = true;
}
public void UnProtect(IntPtr handle)
{
if (isProtect)
{
SetWindowDisplayAffinity(handle, 0);
isProtect = false;
}
}
}
}