Hello, for the C# project I am working on I need to get screenshots of all the open windows (like the window thumbnails in the taskbar, but full size). It must also get images from windows that are not on the visible screen area (half/all of the window is off the screen).
Please don't reply with, graphics.copyfromscreen(), because it does not return parts of the window that are off the screen.
Does anyone know how I can do this?
If anyone has an idea, please post some demo code, or a place that i can find some demo code.
(running Windows 7 Home, with Microsoft Visual C# 2010 Express)

K Andrews10 reputationPosted Nov 18, 2014, 7:31 PM EST
This does not do what I need. I need a way of getting screenshots of a given window (by handle), not the screen. This answer also does not return parts of windows that are off of the screen.
Vasu GadhiyaRank #7,540 · 239 reputationPosted Nov 18, 2014, 7:17 PM EST
{
Rectangle bounds = this.Bounds;
using (Bitmap bmpScreenCapture = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height))
{
using (Graphics g = Graphics.FromImage(bmpScreenCapture))
{
g.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, bmpScreenCapture.Size, CopyPixelOperation.SourceCopy);
}
bmpScreenCapture.Save(savepath, System.Drawing.Imaging.ImageFormat.Jpeg);
}
}
----------------------
Use this Function.