- {
- HWND hWnd = (HWND) wParam;
-
- // we don't convert from screen to client coordinates as
- // the event may be handled by a parent window
- wxPoint p(LOWORD(lParam), HIWORD(lParam));
-
- wxContextMenuEvent contextEvent(wxEVT_CONTEXT_MENU, GetId(), p);
- GetEventHandler()->ProcessEvent(contextEvent);
-
- // set processed to true even if the event is not handled because if we don't
- // windows will propogate the WM_CONTEXTMENU up the parent window chain, which
- // we have already done ourselves.
- processed = true;
-
+ {
+ // we don't convert from screen to client coordinates as
+ // the event may be handled by a parent window
+ wxPoint pt(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
+
+ wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU, GetId(), pt);
+ GetEventHandler()->ProcessEvent(evtCtx);
+
+ // set processed to true even if the event is not handled
+ // because if we don't windows will propogate the
+ // WM_CONTEXTMENU up the parent window chain, which we have
+ // already done ourselves.
+ processed = true;
+ }