How to get a clipboard paste notification and provide my own data?

前端 未结 2 891
暗喜
暗喜 2021-02-03 12:34

For a small utility I am writing (.NET, C#), I want to monitor clipboard copy operations and clipboard paste operations.

My idea is to provide my own data when pasting in

2条回答
  •  [愿得一人]
    2021-02-03 13:00

    You need to hook in the clipboard hook by using a windows hook. A windows hook is a way of intercepting global events happening and providing your own hook procedure to replace or intercept the message. Have a look here on CodeProject that explains how to hook. Here's a clipboard helper that listens for the copy/paste functionality. Here's a Clipboard spy that just does that. Here's another article that implements a Clipboard hook.

提交回复
热议问题