can't disable ctrl-V on a rich edit control
Hi there,
I am trying to disble the Ctrl-V key function for a rich edit control. I set the ENM_KEYEVENTS event mask filter and I handle my WM_NOTIFY message as follows...
Code:
case WM_NOTIFY:
switch( ((LPNMHDR)lParam)->code ){
case EN_MSGFILTER:
if( ((MSGFILTER*)lParam)->wParam == 0x0016 ){
MessageBox( hwnd, "Ctrl-V", NULL, MB_OK );
return 1; //disables the key
}
break;
}
break;
This code fails to prevent the Ctrl-V button from pasting into the rich edit control. I know that the if statement is being executed because I get a message but I still get the text pasted into the rich edit control. What am I doing wrong?