1

I need to make a simple service application that will bind to the Windows clipboard. Specifically, any time a copy/cut operation takes place I want to analyze the content and under certain conditions do something with the data.

I know that clipboard managers exist but, from what I gather, they use old COM APIs.

I'm not afraid of COM dll calls but I'm curious, is there a way to do this in pure .Net or do I still need to register a clipboard listener using COM?

RLH
  • 15,230
  • 22
  • 98
  • 182
  • Is this in Windows 7 or 8 ? – Micah Armantrout Sep 20 '13 at 19:59
  • As a side note, this article (http://www.developer.com/net/csharp/article.php/3359891/C-Tip-Monitoring-Clipboard-Activity-in-C.htm) is what every implementation does to listen to the clipboard. As you can see from the article, it is dated from 2004. I can use this as a solution, but in the days of Windows 8, I'm wondering if there is a better way. – RLH Sep 20 '13 at 19:59
  • @MicahArmantrout. Assume both. – RLH Sep 20 '13 at 19:59
  • Check this out - http://stackoverflow.com/questions/15333746/clipboardinterop-content-changed-fires-twice – Micah Armantrout Sep 20 '13 at 20:01
  • @MicahArmantrout That's essentially what I'm trying to avoid. I don't mind doing it that way. Especially if that's the "correct" way to do it. However, I'd rather avoid com/interop calls if this has completely implemented in a .net assembly. – RLH Sep 20 '13 at 20:07

1 Answers1

1

Then this is all new I can see

http://msdn.microsoft.com/en-us/library/windows/apps/br205867.aspx#events

and I think this is strictly Windows 8

Micah Armantrout
  • 6,781
  • 4
  • 40
  • 66
  • I see. I'm having to read between the lines a bit, but I do think this solves the problem. It looks like there is a way to do this with the forward-moving way of publishing apps through the Windows App Store. I imagine for legacy apps, I most still use COM. For newer, Win 8 Apps, can use the method outlined above. Not what I was hoping for, but certainly an answer. – RLH Sep 20 '13 at 20:23