+
+ if ( !processed )
+ rc = wxControl::MSWWindowProc(nMsg, wParam, lParam);
+
+ return rc;
+}
+
+WXLRESULT
+wxTreeCtrl::MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
+{
+ // default WM_RBUTTONDOWN handler enters modal loop inside DefWindowProc()
+ // waiting for WM_RBUTTONUP and then sends the resulting WM_CONTEXTMENU to
+ // the parent window, not us, which completely breaks everything so simply
+ // don't let it see this message at all
+ if ( nMsg == WM_RBUTTONDOWN )
+ return 0;
+
+ // but because of the above we don't get NM_RCLICK which is normally
+ // generated by tree window proc when the modal loop mentioned above ends
+ // because the mouse is released -- synthesize it ourselves instead
+ if ( nMsg == WM_RBUTTONUP )