Capturing and taking a screenshot of a window in a loop
Well, yes, you're holding on to a bunch of IDisposable objects which should be dealt with by employing the using statement:

IntPtr hwnd;

using (var proc = Process.GetProcessesByName(prcname)[0])
{
    hwnd = proc.MainWindowHandle;
}

RECT rc;
NativeMethods.GetWindowRect(hwnd, out rc);
using (Bitmap bmp = new Bitmap(rc.Width, rc.Height, System.Drawing.Imaging.PixelFormat.Format32bppPArgb))
{
    using (Graphics gfxBmp = Graphics.FromImage(bmp))
    {
        IntPtr hdcBitmap = gfxBmp.GetHdc();
        try
        {
            NativeMethods.PrintWindow(hwnd, hdcBitmap, 0);
        }
        finally
        {
            gfxBmp.ReleaseHdc(hdcBitmap);
        }
    }

    using (MemoryStream ms = new MemoryStream())
    {
        bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
        return new MemoryStream(Lz4.CompressBytes(ms.GetBuffer()));
    }
}


Plus, the MemoryStream you return should be Dispose()'d be the calling code.