I am trying to create a context menu that pops up when you right click a RichEdit. I know how to create the context menu, but I don't know how to check for when the user right-clicks RichEdit.
This is what I have:
case WM_CREATE:
{
// Create RichEdit Control
// SetEventMask to ENM_MOUSEEVENTS
}
break;
case WM_NOTIFY:
{
if(((LPNMHDR)lParam)->code == EN_MSGFILTER && ((LPNMHDR)lParam)->idFrom == ID_CTRL_RTB)
{
if(((MSGFILTER*)LOWORD(lParam))->msg == WM_RBUTTONDOWN) // Im tried NM_RDOWN, but MSDN says it's not supported
{
MsgBox("You right clicked it", "info", MB_OK); // replace with context menu
}
}
}
break;
The thing is that I can't get the WPARAM and LPARAM from the MSGFILTER structure from EN_MSGFILTER. Is there a more simple way to track mouse clicks?