views:

240

answers:

1

Possible Duplicate:
Babylon Text Select

Like Babylon. When you click on a word, it grabs the text. How can I do this? Thanks.

A: 

One way is Accessibility API, which will only work for applications that support screen readers. In C# you can use Managed Winapi for this, start at the SystemAccessibleObject class...

I think Babylon uses OCR on the displayed image, which works well as long as you use a standard font at standard sizes.

mihi
Okay, thanks. So I should use SystemAccessibleObject.FromPoint and the cursor position, and then use the Value property?
I tried this: System.Threading.Thread.Sleep(1000); MessageBox.Show(ManagedWinapi.Accessibility.SystemAccessibleObject.MouseCursor.Value);but it's not working
Yes, start with SystemAccessibleObject.FromPoint, but you will have to check its Type and maybe move up to its parent a few times until you get the value you really want...
mihi