Re: How to capture visible text from Command Window
- From: Avi <avi.iitr@xxxxxxxxx>
- Date: Thu, 3 Sep 2009 10:06:06 -0700 (PDT)
Thanks for the replies guys.
The reason i need to capture the console text is - I am trying to
write a .NET plug-in to be used in a automation tool liek QTP to
automate a console based legacy application. My intent there is send
some commands and verify the output received.
As Pete has mentioned, I also feel that OCR is one of the possible
option. I am trying that using MS Document Imaging COM component), but
there are other challenges.
Anyways, If i get a solution, I will post back.
-Av
On Sep 3, 9:33 pm, "Peter Duniho" <no.peted.s...@xxxxxxxxxxxxxxxxxx>
wrote:
On Thu, 03 Sep 2009 08:13:02 -0700, Avi <avi.i...@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
.
- References:
- How to capture visible text from Command Window
- From: Avi
- Re: How to capture visible text from Command Window
- From: Peter Duniho
- How to capture visible text from Command Window
- Prev by Date: Re: Is there a totally-free (for all purposes) ActiveX control (for C#
- Next by Date: Re: DateTime
- 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
|