You can capture the WM_PASTE message ie.
Private Const WM_PASTE = &H302
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_PASTE Then
Dim txt As String =
Clipboard.GetDataObject().GetData(GetType(String))
End If
MyBase.WndProc(m)
End Sub
> I've been able to monitor copy/cut events using PInvoke and User32
> SetClipboardViewer, but I need to capture Paste events as well.
[quoted text clipped - 3 lines]
> Regards,
> Jim.
Jim - 02 Aug 2005 09:01 GMT
> You can capture the WM_PASTE message ie.
>
[quoted text clipped - 15 lines]
>>Regards,
>>Jim.
Overriding WndProc will only work for controls in the samme process as
my application. I need to be notified when other windows applications
paste the contents of the clipboard.
A global windows hook should allow me to catch WM_PASTE messages for any
active application, but I'm hoping there is a simpler and more elegant
solution.