I need to run some code to capture the window of an application running on the windows desktop (windows XP is fine here).
There are a number of VB6 examples on the web, but they tend to capture the running VB6 application or the desktop only. I am looking for a solution that captures a given window/application. So, I want to be able to supply the name of the application window to capture.
A quick Bing search did result in some code examples, but they captured the desktop or the current running VB6 application. I am willing to modify one of these to capture a given window (named application).
However before I do this, perhaps someone has an link to a vb6 or VBA library code example that will capture/save a given named application window to a bmp or some type of image file on the hard disk.
An link to an VB6 or VBA solution is just fine here. I am willing to modify an existing example.
You probably already know this, but windows are identified by a unique 4-byte long called the window handle. Any code sample to get a screen capture can do any window: the desktop, the current application, or any running application. You just need to use the right window handle.
Here's some building-blocks:
GetDesktopWindow()
. I put together some code here to capture an error from Access in another application, as an exercise, it uses windows to do this, so the code may be of use to you: http://forum.lessthandot.com/viewtopic.php?f=95&t=7969#p39648
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With