开发者

Get image of any window without taking a screen shot?

I'm looking for a way to get a picture of the Main Window of a process without getting a screenshot of the whole desktop. I want to be able to get a picture of minimized windows and covered windows. Ideally I'd like to get this image as a Bitmap object for later manipulation.

I can already get the hwnd for the Main Window using System.Diagnostics.Process, where can I use that hwnd to get the image of the window? I do expect to need to use the WinA开发者_运维知识库PI, I just don't know where.


Create a memory DC. Send the handle of that memory DC to the hWnd of the main window to a PRINT message to the window.

  • http://www.pinvoke.net
    Great way to explore WINAPI and figure out how to call the different methods.
  • http://www.codeguru.com/Csharp/Csharp/cs_graphics/drawing/article.php/c6137
    This article shows how to create Memory DCs using pinvoke.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜