I have C# window application and I want to get text where the cursor is currently located or text is selected from the other application like notepad, notepad++ or any browser etc.
Did you already have a look at this CodeProject article ? This could be a start even if this is not exactly what you are looking for.
See http://msdn.microsoft.com/en-us/library/windows/desktop/ms632604(v=vs.85).aspx.
If it do not solve your issue, have a look at http://msdn.microsoft.com/en-us/library/system.windows.automation.textpattern.getselection(v=vs.110).aspx, as suggested in the comments.
1.4m articles
1.4m replys
5 comments
57.0k users