How can i get "paste event" from the clipboard?

Y

yevron2

Hello,

I am tring to write a clipboard spy that catches events from the
clipboard.
I used the SetClipboardViewer api to get events when data is copied
into the clipboard, and also GetClipboardOwner to know where the data
was copied from, but i don't know how to get an event when data is
being pasted... not in my application only, anywhere.

Is there an other way other than a hook on the keyboard?
I don't want to catch all keyboard actions just to know that ctrl+v
was pressed... you can also paste from a menu and not using ctrl+v and
i will miss it...

Thank you!
 
Y

yevron2

It will take some unmanaged interop to do this, as you have to register your
app to listen for Clipboard events, and use the WndProc method to intercept
them. There's a nice article on how to do this here:

http://www.radsoftware.com.au/articles/clipboardmonitor.aspx

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composerhttp://unclechutney.blogspot.com

The shortest distance between 2 points is a curve.









- Show quoted text -


Thank you.
But i already did that... event is raised only when copy is done, not
paste.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top