Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
335 views
in Technique[技术] by (71.8m points)

.net - C# window application get word from the cursor position from the other application

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...