I have an application written in C# that monitors any clipboard activity. Everything works great as far as registering the application as a clipboardviewer, calling an event when a passing the clipboard chain on and then unregistering.
In a nutshell the application keeps the last 5 items that were cut or copied to the clipboard. If you click on any one of the 5 history items, the item you click on is put on the active clipboard (essentially copied).
My problem is when my application places text on the clipboard it fires the clipboard event and adds the item to the clipboard history again.
Does anyone have any insight as to how I could work around this? At first I thought maybe if I could find out which application was making the original clipboard call I could ignore my applications calls. That' won't work though because if actual text is cut or copied within my application I want it to go in the history. The only time I want to ignore it is when I restore an old item to the current active clipboard.
Sorry I don't have any technical code examples to go along with my question. It's not the code, it's the approach that I'm stumped on.
Please let me know if you need any more information.
Any advice is greatly appreciated.
Thanks in advance,
bjordan
In a nutshell the application keeps the last 5 items that were cut or copied to the clipboard. If you click on any one of the 5 history items, the item you click on is put on the active clipboard (essentially copied).
My problem is when my application places text on the clipboard it fires the clipboard event and adds the item to the clipboard history again.
Does anyone have any insight as to how I could work around this? At first I thought maybe if I could find out which application was making the original clipboard call I could ignore my applications calls. That' won't work though because if actual text is cut or copied within my application I want it to go in the history. The only time I want to ignore it is when I restore an old item to the current active clipboard.
Sorry I don't have any technical code examples to go along with my question. It's not the code, it's the approach that I'm stumped on.
Please let me know if you need any more information.
Any advice is greatly appreciated.
Thanks in advance,
bjordan