我在CTreeView 这加入对鼠标右击的响应函数:OnRButtonUp(),结果他不响应!我非得双击右键才有反应,不知道是什么原因。
请教各位大侠。

解决方案 »

  1.   

    可能是被TreeView中的这个消息WM_CONTEXTMENU给拦截了!!
    The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button (right clicked) in the windowIf a window does not display a shortcut menu it should pass this message to the DefWindowProc function. If a window is a child window, DefWindowProc sends the message to the parent. Otherwise, DefWindowProc displays a default shortcut menu if the specified position is in the window's caption.DefWindowProc generates the WM_CONTEXTMENU message when it processes the WM_RBUTTONUP or WM_NCRBUTTONUP message or when the user types SHIFT+F10. The WM_CONTEXTMENU message is also generated when the user presses and releases the VK_APPS key.
      

  2.   

    我响应WM_CONTEXTMENU消息,结果还是一样的:没有反应。
    还请指教。
      

  3.   

    我在一个对话框中动态创建了一个CMyTreeCtrl,结果不能响应ON_ITEMEXPANDED消息