Key discovery

I am writing a program that extends the use of the clipboard, but I need to tell when the user has either cut, copied, or pasted something so that I can write code to match that. I need to know how I can check when a user has entered a command like this.

+2


source to share


2 answers


The problem with keystroke keystrokes is what if someone clicks the Copy button on the toolbar or goes to the Edit> Copy menu in the menu?



What you probably need to do is trap an event emitted by the clipboard itself whenever it changes. Taking a look at google it looks like there is no .NET api yet, but there is still old Win32 ... Create Windows Clipboard Monitor in VB

+2


source


I don't know if finding the keys is the best way.



In any case, you can find out if the contents of the clipboard have changed by tracking it.
Check out this article: How to Control the Clipboard in Visual Basic

+1


source







All Articles