mark2004 Posted May 26, 2004 Posted May 26, 2004 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
brett Posted May 26, 2004 Posted May 26, 2004 Have you looked at the help file? Also take a look at the Window Spy. Look at ControlGetText, or WinGetText maybe? -Brett
mark2004 Posted May 26, 2004 Author Posted May 26, 2004 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
SweatyOgre Posted May 26, 2004 Posted May 26, 2004 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.
SweatyOgre Posted May 26, 2004 Posted May 26, 2004 What if I wanted to read a number in an IE page, and perform an action based on the value of that number?
mark2004 Posted May 27, 2004 Author Posted May 27, 2004 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......;>
SweatyOgre Posted May 27, 2004 Posted May 27, 2004 I haven't been able to come up with anything else, so im thinking thats the only possible way, long as it is.
MattNis Posted May 27, 2004 Posted May 27, 2004 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]
mark2004 Posted May 28, 2004 Author Posted May 28, 2004 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.
SweatyOgre Posted May 28, 2004 Posted May 28, 2004 I looked for a good OCR yesterday, couldn't find anything, so please so update if you find a good one.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now