简体   繁体   English

C#中的复制/粘贴事件监听器

[英]copy/paste event listener in C#

I'm new to C# (I'm used to Java) and am trying to implement a listener that can run in the background of a Windows XP computer and be able to see when a user does a copy, cut, or paste operation. 我是C#的新手(我曾经使用过Java),并且正在尝试实现一个侦听器,该侦听器可以在Windows XP计算机的后台运行,并且能够查看用户何时执行复制,剪切或粘贴操作。
I found this page and have attempted to implement that listener, but I keep having problems. 我找到了此页面 ,并尝试实现该侦听器,但是仍然遇到问题。

My question is two fold: one, will the listener on this page solve my problem? 我的问题有两个方面:一,此页面上的听众能否解决我的问题? and if so, any tips on implementing it? 如果是的话,有什么实施技巧吗? I'm getting: 我越来越:

The type or namespace name 'DragDropOrCopyPasteEventArgs' could not be found (are you missing a using directive or an assembly reference?) 找不到类型或名称空间名称“ DragDropOrCopyPasteEventArgs”(您是否缺少using指令或程序集引用?)

I've tried attaching the necessary assembly reference, but I don't seem to have the correct dll. 我尝试附加必要的程序集引用,但似乎没有正确的dll。

Thanks a ton in advance. 在此先感谢一吨。 (before anyone asks, I am not writing a virus, its a writing analyzer) (在有人问之前,我不是写病毒,而是写分析器)

For copy listener please look into this question here and an article here . 对于复制侦听器,请在此处查看此问题并在此处查看文章。

As for the paste event as discussed in the above thread there seems to be some confusion as clipboard listener does not provides any feedback on pasting. 至于上述线程中讨论的粘贴事件,似乎有些混乱,因为剪贴板侦听器未提供任何有关粘贴的反馈。 You may have to install global hooks to capture CTRL + V and mouse context menu. 您可能必须安装全局挂钩才能捕获CTRL + V和鼠标上下文菜单。

for using key hook please read this CodeProject article. 有关使用钥匙钩的信息,请阅读此CodeProject文章。

for listening to mouse events and movement please visit this another CodeProject article and this msdn page about WIN 32 hooks. 听鼠标事件和移动请访问此另一个CodeProject上的文章, 对WIN 32钩MSDN页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM