If there is formated text into the clipboard but I want to paste only plain text i have to use EM_PASTESPECIAL and set CF_TEXT as the format.

Ok..all right so far, but i want to paste plain text also when pressing "CTRL + V" into a richedit. I've subclassed it already but now I don't know how to let the programm know that the user presses Ctrl+V .

I've used WM_CHAR but it does not work.
Any ideas?

Posted on 2002-03-12 12:02:47 by Rennsemmel


.if uMsg == WM_KEYDOWN
.if wParam == VK_CONTROL
;do whatever
.elseif wParam == VK_V
;do whatever

this will at least let you know when one or the other is pressed while your richedit has focus. the problem i have is how to recognize that both are pressed at the same time. i tried something like this:

.if wParam == VK_CONTROL && VK_V
;do whatever

and this didnt work. so maybe this might get you going in the right dirrection.. *shrug*
Posted on 2002-03-12 14:53:01 by smurf
GetAsyncKeyState - can handle 2 key down messages, the worst of all you have to recode your main loop, but that isn't a problem. :)
Posted on 2002-03-12 15:13:06 by stryker

You must process what you are after in the main loop. Trap the WM_KEYUP/DOWN messages and bypass the original and substitute your own Ctl+V handling with the WM_PASTESPECIAL style.


Posted on 2002-03-12 20:24:58 by hutch--
Depending on what else is happening in your program it may be worth considering defining Ctrl-V as an ACCELERATOR

Posted on 2002-03-13 05:18:21 by eGo
What about subclassing WM_PASTE?
Posted on 2002-03-15 04:38:48 by bazik