Is it possible to get a screenshot of a window that is not on the top, i.e. if it is partially hidden by another window, without bringing it to the top?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
Unfortunately, it's not trivial to take a screen-shot in C# at all, you can create a graphics object based on the current window or viewport and capture that, but its not what you're asking for.
This
Screenshot of Hidden Window
might help, but you'd have to do this with Interop code anyway.
I dare say that it's not a common thing that is supported as really, one program has no business knowing what's being displayed in another program; it's potentially a nasty exploit.
You dont need to take screenshot, if it is your application you can use
Control.DrawToBitmap(Bitmap bitmap, Rectangle targetBounds);
of the form object.If it is other application window, you can try un-managed way to get the UI of window. I dont remember all the methods but I have tried and it was working. Probably
GetWindow
andSendMesage
withWM_PRINT / WM_PRINTCLIENT