I found more elegant solution
public const uint WDA_EXCLUDEFROMCAPTURE = 0x00000011;
[DllImport("user32.dll")]
public static extern uint SetWindowDisplayAffinity(IntPtr hWnd, uint dwAffinity);
...
SetWindowDisplayAffinity(currentWindowhWnd, WDA_EXCLUDEFROMCAPTURE);