views:

66

answers:

3

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

+2  A: 

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

What you probably need to do is trap an event emitted by the Clipboard itself for whenever it changes. Glancing at Google it seems there isn't a .NET api yet, but there is still an old Win32 one... Create a Windows Clipboard Monitor in VB

T. Stone
+1  A: 

I don't know if detecting keys is the best way to do that.

Anyway, you can find out if the clipboard contents changed by monitoring it.
Check out this article: How to monitor the clipboard in Visual Basic

Nick D
A: 

Thanks Nick D. Its working well for me

Baseballonline