Skip to content

Clipboard events

Brad

Asked Feb 11, 2007, 4:19 PM EST3 answers
Share
LinkedInX

How can I get my aplication to detect a change in the contents of the clipboard?

3 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Is it safe to just use a timer, and just parse the contents?
    0
  • 0
    Safe? Yes. Efficient? No. Well actually it depends on the interval of the timer.

    One way would be to use the Win32 API function SetClipboardViewer(). You can use this function through P/Invoke, but you'd also need to define your own WndProc so you can handle the events that are sent to your application. See this page for an example: http://www.radsoftware.com.au/articles/clipboardmonitor.aspx
    0
  • 0
    Thanks, that works great.

    Do you know of a way to do it using .NET?
    0