Reputation: 3290
I'm pretty sure that's a very difficult task. Did anyone out there know how we can overrides the copy-paste capability under Windows OS?
(Overriding for the complete environment... patching the Windows OS itself.)
Ex : Trim the copied text after copying it.
Thank you.
Upvotes: 0
Views: 1175
Reputation: 25824
It is highly unlikely that you actually need to patch the OS itself, considering that Windows always provides the ability to hook on the clipboard events directly and override them however you wish. See How to get a clipboard paste notification and provide my own data? .
Upvotes: 1
Reputation: 224859
Yes, but you haven't specified the language. Here's how you might in VB.NET (put this in a Timer
's Tick
handler):
If Clipboard.ContainsText() Then
Dim s As String = Clipboard.GetText()
Dim t As String = s.Trim()
If s <> t Then Clipboard.SetText(t) 'Trim all text, for example
End If
Upvotes: 0