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.

1 Answer
1

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: