Read Text From Windows Form

Posted by omghai2u on Stack Overflow See other posts from Stack Overflow or by omghai2u
Published on 2010-04-24T05:28:23Z Indexed on 2010/04/24 5:33 UTC
Read the original article Hit count: 243

Filed under:
|
|
|

I would like, if for no other reason that an academic exercise, to be able to read text written to a form on a Windows Application. The program appears to be written in non-.NET, but in .NET terms, I think you would describe the program as having a Form with a Label and I would like to read the text from that label.

I believe I can see that text being written to the screen with the User32!TextOut (and in other areas User32!DrawString) function. However, it would be nice if I didn't have to hook that function to get the information I'm looking for, but instead if I could just read it from the form directly.

So, given a handle to a Window, is it possible to read the text that has been written to that window with functions like TextOut and DrawString using some similar API or other clever means?

Or am I going about this the wrong way? Should I just hook the function and look for the text in every call and pray?

Thanks!

© Stack Overflow or respective owner

Related posts about win32

Related posts about Windows