I am using a richedit control (richedit32.dll) and I want to get the WM_CONTEXTMENU message to the parent window. Problem is, RE32 eats all the mouse messages. So, I used the events notify to capture the wm_rbuttonup message, and used SendMessage to send wm_contextmenu (with cursor x,y position) to the parent window. Here's the problem--> the wm_contextmenu message dissappears!! It seems so simple, what am I missing?? I do this:
UINT uID = (UINT) wParam;
MSGFILTER *pmf = (MSGFILTER*) lParam;
if (pmf->msg == WM_RBUTTONUP)
if ((void*)GetWindowLong(hWnd,GWL_WNDPROC) != (void*)TextWndProc)
MessageBeep(0); // never gets here!!
//TextWndProc(hWnd,WM_CONTEXTMENU,0,pmf->lParam); // works!!
SendMessage(hWnd,WM_CONTEXTMENU,0,pmf->lParam); // does not!!
*pResult = 0;
I put a breakpoint on the wm_contextmenu case in the parent window proc, trace thru SendMessage, (which returns) and the breakpoint is never hit. If I call the window procedure directly (commented out above) it works fine. Where did my message go????