PrintWindow

[DllImport("user32.dll", SetLastError = true)]
public static extern bool PrintWindow(
   IntPtr hwnd,
   IntPtr hdcBlt,
   uint nFlags
);

Microsoft documentation: Link

Last updated