This question is aimed for either Windows or Linux platforms. It’s a general question that may come across as someone with ill intent, but that is not the case.
I would like to know if there is programmatic method to read the text being display in a window of another application? The language and GUI library is flexible, i.e. anyone will do.
The example is there will be a page in say a Chrome or Firefox browser window or a standalone third party app which will display some stats in one of its inner windows. I want to create an app which can read in some of those stats.
I apologise for the vagueness of this question but I’m looking into viable methods for a potential project.
Under windows for standard controls, for example if text for control is being set with WM_SETTEXT, then you can find this control by enumerating window hierarchy for aplication and call WM_GETTEXT to get that text.
If text is drawn using WinAPI function like DrawText(), then it will be harder. You can use Windows Accessibility APIs, I have never used it but it looks promising. Here you will find some info on that:
http://blogs.msdn.com/b/oldnewthing/archive/2004/04/23/118893.aspx
Maybe you should look for Chrome or Firefox APIs that would allow to achive what you want?