Capture image of App#A's window from App#B

Capture image of App#A's window from App#B

Post by RnJlZGVyaW » Sun, 26 Apr 2009 23:11:01

How can I capture (an image) of the contents of Application #A window ...
from Application #B. Let's say there are two, totally separate, independent
applications running, #A & #B. From Application #B, I want to locate
Application #A, then locate #A's currently active desktop window and capture
an image of whatever's being shown.

Application #A - I have no idea what programming method/tools were used to
create this app, but is runs in XP.

Application #B (the imager capturer) - will be written using the .NET CLR
and either C# or VB.NET in a Winforms Applications.

Any pointers or help appreciated.


Capture image of App#A's window from App#B

Post by RnJlZGVyaW » Mon, 27 Apr 2009 00:27:01

Found answers myself!

The easiest way to do this is to activate the window and to send an
Alt-PrtScr keypress event. After that you can simply read the captured image
from the clipboard. How to send a printscreen or alt-printscreen is explained
by me in this thread on EE on using SendKeys.

To find the window of a particular application, this link will help,

To capture the screenshot of the whole screen or a particular are, this will

Once you obtain the handle to the application, find its location and
dimensions and capture the image of that area.