Re: How to capture visible text from Command Window
- From: "Peter Duniho" <no.peted.spam@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 03 Sep 2009 09:33:17 -0700
On Thu, 03 Sep 2009 08:13:02 -0700, Avi <avi.iitr@xxxxxxxxx> wrote:
Hi,
I need to capture visible text from a command line application for
some automation purpose. I have created functions using WIN32 API
functions GetForegroundWindow, GetWindowText, SendMessage etc.
[ Below is the functions I am using. ]
**Challenge I am facing is - when i try to get text from console
application it gives only the title message, other details are
missing. **
Since AFAIK Windows doesn't know anything about the text displayed in a console window, I doubt you can do this without much more complicated code. You'd need to capture the actual image, and then perform some kind of optical-character-recognition algorithm on the image to convert it back to the original text. Of course, there's no shortage of pitfalls in doing something like that, not the least of which is the problem of dealing with overlapping windows.
Normally, if you want the text output of a console application, you write a program that is the one that actually starts the process running the application, and which redirects the standard output and standard error streams to capture the text directly as the console application runs. If you have control over the application being run, this is what you should do.
Pete
.
- Follow-Ups:
- References:
- Prev by Date: Re: Drawstring on image at differnet DPI's
- Next by Date: Re: ?? A Lambda Equivalent of this Delegate ??
- Previous by thread: Re: How to capture visible text from Command Window
- Next by thread: Re: How to capture visible text from Command Window
- Index(es):
Relevant Pages
|