0

I am able to catch the right click of the mouse but i want to catch RIGHT CLICK + COPY/PASTE event

I tried to search on net but unable to get a single proper answer.

Muzammil Ansari
  • 143
  • 1
  • 13
  • which context does it have? Windows forms? – Alex H Aug 11 '15 at 15:02
  • Look here: http://stackoverflow.com/questions/1156975/copy-paste-event-listener-in-c-sharp – Icemanind Aug 11 '15 at 15:04
  • yes and i want to capture it in all the application – Muzammil Ansari Aug 11 '15 at 15:05
  • There isn't a **single**, "proper"" answer because it's more complicated than you think. You can trap WM_PASTE, but that'll only catch basic edit controls. Rich edit controls, like the RichTextBox, handle it differently (and only on certain minimum operating systems). Can you be more specific about what types of controls you want to trap paste on? – Idle_Mind Aug 11 '15 at 16:54
  • Actually what i wanna do is i wanna catch all copy paste event globally. now i am able to get ctrl + c and ctrl+ v event using keypress event but i want to track when the user copy or paste globally using the mouse.now iam able to detect the mouse right click event. – Muzammil Ansari Aug 12 '15 at 04:47

2 Answers2

0

I've found some useful hints in an other post:

If you want to handle the Paste operation yourself, before it even happens, you will have to intercept the WM_PASTE message to the text box. One way of doing is would be by creating a specialized control.

You can find the code here

Community
  • 1
  • 1
0

Question is not clear to me
If you will add specifics I will try and help

I do what may be what you are asking with ContextMenu
This is cut, but you would use Paste
CopyToDigest would be your custom handler

CommandBindings.Add(new CommandBinding(ApplicationCommands.Cut, CopyToDigest, CopyToDigestOK));

I got it from the book Pro WPF by McDonnald

paparazzo
  • 44,497
  • 23
  • 105
  • 176