Sign in to follow this  
Followers 0
mark2004

retrieve text from certain portion of window

10 posts in this topic

I would like to retrieve the text in a certain portion of the screen on a terminal

emulation program and perform actions based on the result. It would be nice if

I could define the coordinates of a box within the window and use a function to retrieve the text within those boundaries.

Is this possible?? I sure hope so!!

Thanks in advance.

Mark :D

Share this post


Link to post
Share on other sites



Have you looked at the help file? Also take a look at the Window Spy.

Look at ControlGetText, or WinGetText maybe?


-Brett

Share this post


Link to post
Share on other sites

Maybe I should have been more specific. First, the text in the window of the

terminal emulation program is not associated with a control. And most importantly, the location of the text in the window is what is most critical. If

I simply got the entire text of the window, I would have no way of knowing whether my "string" of interest was within my coordinate box or in another portion

of the window. Or maybe it is.....this is the crux of my problem..

I hope this makes sense.

Mark

Share this post


Link to post
Share on other sites

I have a similar problem in a script I am writing. I couldn't think of a way to do it, so I was wondering if it would be possible for it to highlight the text, copy it, paste it into a text file, save the text file, and read the info from that text file, possible making that text file a .ini and use the command IniRead. Although maybe there is an easier way.

Share this post


Link to post
Share on other sites

What if I wanted to read a number in an IE page, and perform an action based on the value of that number?

Share this post


Link to post
Share on other sites

The problem Larry is that the position of the text "on the screen" (the pixel position)

of the text is what is needed. Not necessarily the position of the text within the string of the entire screen.

Oftentimes I work with terminal emulation software for data entry programs. These typically have "DOS" like layouts of text. No windows-based controls although the terminal is running within windows. There is often a portion of the screen which has important information that I would like to make decisions based on. The different "pages" or "screens" within the program have radically different

layouts but the pixel position of the critical information remains the same. If you

retrieved the screen text, the critical portion may be on the 8th line on one screen

and on the 12th line on another due to some screens having lines that use very large fonts etc. But, the pixel position of the critical information would remain constant.

I think selecting with the mouse and using the clipboard is a good idea and should work. But it would be nice if there were an easier way......;>

Share this post


Link to post
Share on other sites

I haven't been able to come up with anything else, so im thinking thats the only possible way, long as it is.

Share this post


Link to post
Share on other sites

use a free OCR program.

you should be able to find a bunch of them on google easily


[quote]I was busy waiting all night for the Columbus Day Bunny to come down my chimney and light fireworks in my pumpkin.There's so much wrong with that.Oh, I'm sorry, i forgot you were Jewish.[/quote]

Share this post


Link to post
Share on other sites

ahah!! That sounds like a good suggestion. I'll see what I can find on google and

try it out. If it solves my problem, I'll update everyone on the forum.

And thanks perkster for the idea to download the source code.....very clever.

Share this post


Link to post
Share on other sites

I looked for a good OCR yesterday, couldn't find anything, so please so update if you find a good one.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0