# vb.net select text from active cursor point in different window



## shuggans (May 13, 2013)

hello all - working on a dictation application and looking for some guidance as far as selecting text from a  cursor point in a window outside of the applications form.  I'll clarify a bit:  The application types at the current cursor point using sendkeys() as you speak.. and I'm trying to handle commands such as "select word" which should select the word to the right of the current cursor point.  I know how to handle selecting text within an application, but am looking to be pointed in the right direction for information on selecting text from say microsoft word etc. but keep in mind the goal for the application is to be universal for use within any EMR, word processor, web browser etc.

Thanks for any assistance!

shuggans


----------



## FordGT90Concept (May 13, 2013)

That is most certainly going to require using Windows functions, likely in user32.dll.  The second post on this page describes how to use WM_GETTEXT:
http://social.msdn.microsoft.com/Fo...s/thread/1dc356e6-9441-44de-9eda-247003fa6ef5


----------



## shuggans (May 13, 2013)

Ifound this code: http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/02a67f3a-4a26-4d9a-9c67-0fdff1428a66/ 
which is a great example - I wonder if I could return the active window name to a string and push that as the window name.... and then grab textfrom cursor location...

Thoughts on this method?


----------

