[.net] Read data from other windows (in other applications)

Started by
2 comments, last by ernow 13 years, 6 months ago
Hey all,


my problem is like this:

im looking for a way to read data from other window (in other application)

lets say i see a window and the window have some text on it (text is not in text area and i CANT copy it with ctrl+ c

i have searched Google and i understand that only approach for this is "OCR"

i thought i could make this by getting a window handle (IntPtr) and with it i would get all the window strings (or something like that), but i didnt found any way to do that...

that brings me back to OCR..

So .. if no other option.. i will try with OCR..
how to do that?
what is best approach to do it when i know i need to read text (and numbers)
i have Googled and found some free codes that can do OCR but i couldn't manage to work it out..


if you know a way to get some text from window in stand of OCR i will be more then happy to hear about it..
if OCR is the only way..
please .. let me know what is the simple approach to do it..

p.s

i saw something about MODI (an office 2007 OCR)
but this bring me to two problems:
1) i couldn't mange this to work out (fixable)
2) MODI need client to have office 2007 (i cant be sure all clients will have office 2007

Advertisement
Did you try to use Spy++ (part of the Visual Studio tools) to spy out whether or not the text is in a Windows control? If it is that would make it much easier, all you would have to do is get the control's handle and use the win api to get the text.



its easy to get the window title..

im talking about a text INSIDE the window
You use the same API to get the text in a textbox. Just pass the HWND of the textbox. You can use Spy++ to findout whether or not it is a real Windows Textbox or something rendered in OpenGL or DirectX.

Can you tell us what application it is you are trying to scrape?

This topic is closed to new replies.

Advertisement