询问者
How does the messages of CDockablePane work?

问题
-
Recently, I am trying to use CDockablePane for my project. I created a CSidePane (derived from the CDockablePane) in my MainFrame, and created a CButtonList (derived from the CWnd) in the CSidePane.
When I debuged the project, I found that when I right-clicked the CButtonList, a contextmenu of CDockablePane popuped. There are "Float","Dock" etc. in the menu. Now I could abandon the contextmenu through overriding the CDockablePane::OnContextMenu.
I just wonder why then CDockablePane's contextmenu popuped when I click the CDockablePane's child window.
Thanks.
- 已编辑 FunnyLeo 2012年3月13日 10:32
全部回复
-
Which place did you click? The place like window title(Have "windows position/Auto Hide/Close" three buttons on right side)?
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.
-
Here is the code in CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
m_SidePane.Create(strLeftDockPane,this,CRect(0,0,200,0),FALSE,IDS_LEFTDOCKPANE,
WS_CHILD | WS_VISIBLE | CBRS_LEFT,NULL,AFX_CBRS_RESIZE);
m_ButtonList .Create(CRect(0,0,100,100),&m_wndLeftDockPane,IDW_NAVIGATIONLIST);When I clicked the ClientRect of m_ButtonList, the contextmenu of m_SidePane popuped.
-
FunnyLeo你好!
你可以尝试一下下面的代码:
BOOL CSizePane::OnShowControlBarMenu(CPoint point) { return FALSE; }
或者你可以重写CDockablePane的OnPaneContextMenu方法。此方法中可以没有操作,只是返回。
祝你好运!
Helen Zhao [MSFT]
MSDN Community Support | Feedback to us
- 已编辑 Helen Zhao 2012年3月20日 1:20