右键单击,文本捕获
我有一个在页面右下角运行的 ac# 应用程序,我想知道当用户在任何地方选择一些文本(例如 pdf、浏览器等)然后右键单击,转到时如何使我的应用程序出现我的客户选择有点说并将该文本粘贴到我正在运行的应用程序中。
如果有人明白这一点,你可以告诉我我需要研究什么才能完成它。
谢谢
I have a c# application that runs in the bottom right corner of the page, i was wondering how i could go about making my application appear when the user selects some text anywhere (say a pdf, browser etc) and then right clicks, goes to my custome selection bit say and it pastes that text in to my running application.
If anyone made any sense of that could you advise me in to what i need to be researching to get it done.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我有一本字典,它有类似的功能。
这是它的操作模式(或者至少我认为它是这样的)
双击时,它会发送一个键盘命令(可能是 Ctrl+C)来复制所选文本。然后它从剪贴板读取文本。
出于您的目的,您可以通过我在 CodeProject 上找到的这篇文章来实现鼠标侦听和发送击键: InputManager 库。
然后,您可以从剪贴板中检索复制的文本并对其执行任何您想要的操作。
I've got this dictionary which does something similar.
Here's its mode of operation (or at least what I think it does)
When there is a double click, it sends a key command (probably Ctrl+C) to copy the selected text. It then reads the text from the clipboard.
For your purpose, you could implement the mouse listening and sending keystrokes with this article I found on CodeProject: InputManager library.
You then retrieve the copied text from the clipboard and do whatever you want with it.
查看剪贴板监视器
Have a look at a Clipboard monitor
您可以挂接到Windows消息传递API,可能有一个文本选择事件。
You can hook into the windows messaging api, probably there is a Text-selected event.