Read the text on the screen from an external application. API connection?

I have a Java background, so I have limited knowledge when it comes to C # and C ++. Basically I try to "read" the text from another application that is displayed on the screen ...

enter image description here

To be specific, I want to read the dealer chat message from Pokerstars ... on the fly ...

What is the best way to read this text in a Java program on the fly? Ive got a tutorial about API connectivity, this is the only way and how can I do this in Java?

Thanks Phil

+4
source share
2 answers

One way to do this, which works as long as the text is not smoothed, as in your image:

In your application, take a screenshot of another application window. Find a screenshot for all non-white pixels. Make a list of all non-white pixels. For each pair of non-white pixels in the list, if the pair touches each other, put them in the same β€œgroup”. Do this until all pixels are grouped.

Then, for each group, compare its shape with a table of predefined shapes. If the figure is not in the table, ask the user to enter a letter, and then save the figure and its letter in the table.

You now have ASCII codes for all letters in the window.

This is not the cleanest way to clear text from a window, but it's hard to beat. For any movement made by another application to make text more difficult to read by a computer, it becomes more difficult for a person to read, which reduces the usefulness of the application.

+2
source

If the application you want to connect to is C #, then maybe the reflector is a good place to start.

http://reflector.red-gate.com/download.aspx?TreatAsUpdate=1

Another thing you want to peek at is reading network traffic and capturing data at that level. In this case, look at wirehark.

http://www.wireshark.org/

Perhaps you can create a proxy server where data is sent through your application at the network level, and you transmit it, but read the interesting parts.

Good luck.

+2
source

All Articles