CWnd::OnRButtonUp( )
-
I down a example (gridctrl_demo225) to study. in the code one thing puzzled me. platform : VC.Net a CGridCtrl based on CWnd, a Dialog(CDlgA) is the parent of the CGridCtrl instance. following is a part of the code // EFW - Added to forward right click to parent so that a context // menu can be shown without deriving a new grid class. void CGridCtrl::OnRButtonUp(UINT nFlags, CPoint point) { CWnd::OnRButtonUp(nFlags, point); // !!!this call trigers CDlgA::OnContextMenu(...) : : } I read document of CWnd::OnRButtonUp(nFlags, point), it does not say, it will triger parent's OnContextMenu. so if I say CWnd::OnRButtonUp(nFlags, point) calls parent's OnContextMenu(...). Is it right? And the weird thing is I set a breakpoint in CDlgA::OnContextMenu(...) want to see who calls it. There is no records of callstack.
-
I down a example (gridctrl_demo225) to study. in the code one thing puzzled me. platform : VC.Net a CGridCtrl based on CWnd, a Dialog(CDlgA) is the parent of the CGridCtrl instance. following is a part of the code // EFW - Added to forward right click to parent so that a context // menu can be shown without deriving a new grid class. void CGridCtrl::OnRButtonUp(UINT nFlags, CPoint point) { CWnd::OnRButtonUp(nFlags, point); // !!!this call trigers CDlgA::OnContextMenu(...) : : } I read document of CWnd::OnRButtonUp(nFlags, point), it does not say, it will triger parent's OnContextMenu. so if I say CWnd::OnRButtonUp(nFlags, point) calls parent's OnContextMenu(...). Is it right? And the weird thing is I set a breakpoint in CDlgA::OnContextMenu(...) want to see who calls it. There is no records of callstack.
You shouldn't handle
WM_RBUTTONUP
if you want the default context menu handling, because the default window proc will send aWM_CONTEXTMENU
when it seesWM_RBUTTONUP
. If you do context menu handling in response toWM_RBUTTONUP
, the user won't be able to bring up the context menu using the keyboard.--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
-
You shouldn't handle
WM_RBUTTONUP
if you want the default context menu handling, because the default window proc will send aWM_CONTEXTMENU
when it seesWM_RBUTTONUP
. If you do context menu handling in response toWM_RBUTTONUP
, the user won't be able to bring up the context menu using the keyboard.--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ