I have code that takes a screenshot...
Size ssSize;
int ssX, ssY, ssWidth, ssHeight;
Bitmap thisScreenshot;
Graphics gfxScreenshot;
public Image Screenshot()
{
ssX = Screen.PrimaryScreen.Bounds.X;
ssY = Screen.PrimaryScreen.Bounds.Y;
ssWidth = Screen.PrimaryScreen.Bounds.Width;
ssHeight = Screen.PrimaryScreen.Bounds.Height;
ssSize = Screen.PrimaryScreen.Bounds.Size;
thisScreenshot = new Bitmap(ssWidth,ssHeight);
gfxScreenshot = Graphics.FromImage(thisScreenshot);
return((Image)gfxScreenshot.CopyFromScreen(ssX, ssY, 0, 0, ssSize));
}
On W7, the resulting image includes the pixels of the calling window; but on XP it does not. I would like the image to always include the pixels of the calling process/window. Any clue how I can force this?
UPDATE1: I've done more experimentation with this, and as a result I'm more confused... I took the above code and created a totally separate application so that there is no relationship between this and the application that I was originally launching it from. Strangely enough, I am STILL not seeing the window of that application in the screenshot. So now I have no relationship between the process doing the screenshot and the window that I want included in the screenshot; yet, that window is still not included. I did try the PRNT-SCRN button and that does include the window. Note that this is only a problem on XP.