public static Bitmap TakePicture(IntPtr handle = default(IntPtr)) { if (handle == default(IntPtr)) { handle = GetForegroundWindow(); } Rectangle rect = WindowWrapper.GetBounds(handle); return(WindowWrapper.ScreenCapture(rect)); }
private static void MoveToScreen(IntPtr handle, Screen sc) { int state = WindowWrapper.GetState(handle); WindowWrapper.Restore(handle); Screen curr = WindowWrapper.GetScreen(handle); Point abs = WindowWrapper.GetBounds(handle).Location; Point rel = new Point(abs.X - curr.Bounds.X, abs.Y - curr.Bounds.Y); WindowWrapper.MoveAndResize(handle, rel.X + sc.Bounds.X, rel.Y + sc.Bounds.Y); ShowWindow(handle, state); }