Use SetWindowsHookEx
to define a message hook that intercepts messages sent to all windows in your application instead of SetWindowLongPtr.
You also need to change CallWindowProc to CallNextHookEx on your cllback function.
I think you could to collect WM_COPY
, WM_CUT
, and WM_PASTE
events by this way.