0

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.

pilcrowpipe
  • 2,528
  • 6
  • 29
  • 41

1 Answers1

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:

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?

marcinj
  • 48,511
  • 9
  • 79
  • 100
  • Thanks. Unfortunately there are some apps which won't be on webpages so the tips you've given me will be helpful in my investigations. – pilcrowpipe Apr 18 '12 at 21:48