So I have searched for a while on how can you copy what's on your screen or take a screenshot, and I have found some solutions for example this method:
public static Bitmap TakeScreenshot()
{
Bitmap newImg = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
Graphics graphics = Graphics.FromImage(newImg as Image);
graphics.CopyFromScreen(0, 0, 0, 0, newImg.Size);
return newImg;
}
This method works fine, except that when you run an application as administrator, the screen shows something like "Are you sure? YES NO":
Or even on CTRL + ALT + DEL:
At these screens, these methods don't work as they will show a black screen, Also, some applications will give a black screen on them as they are like protected/not on your screen while other things on the screen appear normally.
Why is this happening? and how do I get what am I looking at EXACTLY on my screen?
EDIT #1:
Solution found using PsExec. (Thanks to Koray Elbek)
But still didn't fix the problem that happens with some applications as they will have a black box on them like this:
Why is this happening and how to get the correct screenshot?


