I am developing a software that needs to know when the PASTE EVENT (through the context menu or ctrl+V) happens (only for files / directories). More or less, something like it happens with TeraCopy or Copy Handler. When you copy and then paste, it is TeraCopy that handles the pastings.
I know more or less how to capture the COPY EVENT, you only have to set a ClipboardViewer and you catch all global COPY EVENTS (in fact is called: WM_DRAWCLIPBOARD). You can learn this here: http://www.radsoftware.com.au/articles/clipboardmonitor.aspx But the ClipBoardViewer does not provide you with the ability to catch the PASTE EVENT.
我正在开发一个软件,需要知道何时发生PASTE EVENT(通过上下文菜单或ctrl + V)(仅适用于文件/目录)。或多或少,TeraCopy或Copy Handler会发生类似的事情。复制然后粘贴时,TeraCopy会处理粘贴。我或多或少知道如何捕获COPY EVENT,您只需要设置一个ClipboardViewer并捕获所有全局COPY EVENTS(实际上称为:WM_DRAWCLIPBOARD)。你可以在这里学到:http://www.radsoftware.com.au/articles/clipboardmonitor.aspx但是ClipBoardViewer没有为你提供捕捉PASTE EVENT的能力。
3 个解决方案
#1
1
The process of state change via "Pasting" is specific to individual applications, as such there is no magic way to discover whether the state of an application changed after accessing the clipboard.
通过“粘贴”进行状态更改的过程特定于各个应用程序,因此没有神奇的方法来发现在访问剪贴板后应用程序的状态是否发生了变化。
The best you can do is detect whether an application has retrieved data from the clipboard. Again, there's no way of knowing what the application did with this data. It's akin to knowing someone opened their frontdoor without knowing where they went, if anywhere.
您可以做的最好的事情是检测应用程序是否已从剪贴板检索数据。同样,无法知道应用程序对此数据的作用。它类似于知道有人打开他们的前门而不知道他们去哪里,如果有的话。
If you do want to try this you could do something like hooking the GetClipboardData function. For information about how to palce system-wide API hooks check out the samples in Micrsoft Detours - http://research.microsoft.com/sn/detours
如果你想尝试这个,你可以做一些事情,比如挂钩GetClipboardData函数。有关如何使用系统范围的API挂钩的信息,请查看Micrsoft Detours中的示例 - http://research.microsoft.com/sn/detours
#2
-1
But software like Teracopy and Copy Handler detect the paste event. I need almost the same, detect when a file / directory is pasted.
但是像Teracopy和Copy Handler这样的软件会检测粘贴事件。我需要几乎相同,检测文件/目录的粘贴时间。
#3
-1
In fact, this software does not only work for ctrl+v, but also when you click on the option of paste in the context menu (right click).
事实上,这个软件不仅适用于ctrl + v,而且还可以在上下文菜单中单击粘贴选项(右键单击)。
#1
1
The process of state change via "Pasting" is specific to individual applications, as such there is no magic way to discover whether the state of an application changed after accessing the clipboard.
通过“粘贴”进行状态更改的过程特定于各个应用程序,因此没有神奇的方法来发现在访问剪贴板后应用程序的状态是否发生了变化。
The best you can do is detect whether an application has retrieved data from the clipboard. Again, there's no way of knowing what the application did with this data. It's akin to knowing someone opened their frontdoor without knowing where they went, if anywhere.
您可以做的最好的事情是检测应用程序是否已从剪贴板检索数据。同样,无法知道应用程序对此数据的作用。它类似于知道有人打开他们的前门而不知道他们去哪里,如果有的话。
If you do want to try this you could do something like hooking the GetClipboardData function. For information about how to palce system-wide API hooks check out the samples in Micrsoft Detours - http://research.microsoft.com/sn/detours
如果你想尝试这个,你可以做一些事情,比如挂钩GetClipboardData函数。有关如何使用系统范围的API挂钩的信息,请查看Micrsoft Detours中的示例 - http://research.microsoft.com/sn/detours
#2
-1
But software like Teracopy and Copy Handler detect the paste event. I need almost the same, detect when a file / directory is pasted.
但是像Teracopy和Copy Handler这样的软件会检测粘贴事件。我需要几乎相同,检测文件/目录的粘贴时间。
#3
-1
In fact, this software does not only work for ctrl+v, but also when you click on the option of paste in the context menu (right click).
事实上,这个软件不仅适用于ctrl + v,而且还可以在上下文菜单中单击粘贴选项(右键单击)。