I am using the Clipboard object to play with data copied to the clipboard. Lets say I have a few applications from which I can copy data to the clipboard like Excel, Notepad, etc.
I want to know whether there is any function or any way to find out from where the data is captured in clipboard, whether it is coming from Excel or Notepad or from some unknown application.
I am using C# and .NET 2.0
If you are using SetClipboardViewer api to detect when something is copied to the clipboard and processing WM_DRAWCLIPBOARD message then you can use GetClipboardOwner function to find handle to the window which initiated the operation. Using the handle you can retrieve the process id and path of the executable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With