Skip to content

Instantly share code, notes, and snippets.

@abodalevsky
abodalevsky / DwmSnapshotHelper.cs
Last active May 16, 2023 07:46
Uses DWM to create projection of Window to another window. Clip projection from desktop to memory stream.
// Creates projection of window (specified by HWND) to another window
// Takses snapshot of desktop and clip area where projection is resides
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Draw = System.Drawing;