I was trying to override the onpaste method of the winform textbox using the following method:
When the paste happens I don't want windows to handle it I want my code to. So I did the following:
if (m.Msg == WM_PASTE)
{
var evt = Pasted;
if (evt != null)
{
evt(this, new ClipboardEventArgs(Clipboard.GetText()));
}
}
else
{
base.WndProc(ref m);
}
Is this a safe way to get win32 code to not handle the paste or is there some case I am not seeing?