Closed k1mmm closed 1 year ago
You can use SetWindowDisplayAffinity
to exclude the window which you don't want to record. Here's how you can use that
[DllImport("user32.dll")]
static extern uint SetWindowDisplayAffinity(IntPtr hWnd, uint dwAffinity);
const uint WDA_NONE = 0x00000000;
const uint WDA_MONITOR = 0x00000001;
const uint WDA_EXCLUDEFROMCAPTURE = 0x00000011;
private void includeButton_Click(object sender, EventArgs e)
{
SetWindowDisplayAffinity(this.Handle, WDA_NONE);
}
private void excludeButton_Click(object sender, EventArgs e)
{
SetWindowDisplayAffinity(this.Handle, WDA_MONITOR);
}
@ranwer-dev It worked, thank you!
You can also call it like this to exclude the current window:
IntPtr hwnd = new WindowInteropHelper(this).Handle;
Recorder.SetExcludeFromCapture(hwnd, true);
To include it again, call the same with "false" as param.
Hello! Does the source options support adding multiple windows?
My goal is trying to exclude one window from the recording (in my case the recording controls itself) but I'm getting the error "wrongfully params" when starting the recording.
My idea was to add the screen and all windows but exclude my recording controls window to the RecordingSources list.