Home > Software engineering >  Outloolbar TreeCtrl in response to the mouse message
Outloolbar TreeCtrl in response to the mouse message

Time:10-14

Use the wizard to create a outlook program interface style, the tree view is added in the outlookbar control, are as follows:

CTreeCtrl m_Tree;

That created it is added in the CPP code:

M_Tree. Create (dwTreeStyle rectDummy, & amp; The bar, ID_TREE1);

The above ID_TREE1 defined in header files,

Now interface display is normal, the tree also came out, I want to give it added right-click menu, but do not know how to respond to it the right mouse button, and add the mouse buttons in the MainFrame processing method is valid, the breakpoint show no into the processing program, the right mouse button in any part of the tree CTRL (blank, node, etc.) are just let the outlookbar pop-up it the default right-click menu, only some of the dock outlookbar control for operation,

I try to load the outlookbar OnShowControlBarMenu function, now the default right-click menu doesn't pop up (double click on the right will pop up, click do not), but there is still no way to point treectrl response to the mouse message, which master handle a similar situation, please comment, thank you.

CodePudding user response:

Right-click menu popup is usually added in WM_CONTEXTMENU messages processing

Can consider from the CTreeCtrl derived a new class, and then add WM_CONTEXTMENU messages processing TrackPopupMenu

Or try the parent window add NM_RCLICK event response message processing
  • Related