Sign in to follow this  

how to capture any text on the screen?

This topic is 4197 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to implement such projects that capture any text on the screen no matter what process it belongs to. What should I do? Originally, I want to HOOK those text-out APIs, but I found that, sometimes my function is not invoked, and sometimes, I need to force the control (or somthing) refreshing which will be far more difficult. Hence, I have to determine the exact word that right under my cursor, instead of a whole sentence... Any help will be appreiciated! Thanks in advance!

Share this post


Link to post
Share on other sites
It is impossible to make a water-proof method of reading any text from the screen, since there's so many ways to render text.

For example, consider a double-buffered window. Only the bitmap of the data is transferred to the screen device context, and other programs don't see (nor do they care) by what method the background buffer was filled (even though it very well could've used DrawText).

Second example: D3D/OpenGL. There's no "standard" way of drawing strings to a 3d device, even though some de facto methods such as ID3DXFont::DrawText are widely used. Furthermore, these methods are wildly suspect to change at any time.

You could use some kind of character recognition engine, that converts bitmaps to text. However, this is order of magnitude more difficult than querying window objects of their contents (which is your current approach).

Share this post


Link to post
Share on other sites

This topic is 4197 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this