September 7th, 2010, 02:59 PM
[RESOLVED] clicking in a CDockablePane
Standard disclaimer: I'm new to C++ and MFC.
I currently have a CDockablePane with some items in it. I can catch right-clicks pretty easily with OnContextMenu, but I would like to be able to catch regular and double-clicks as well. I would need to be able to tell what item in the pane they clicked on as well (HitTest for that?).
Anyone have some advice?
September 8th, 2010, 07:08 AM
Re: clicking in a CDockablePane
Well, I think I've got this figured out, so just in case someone else is looking for a solution to the same thing in the future and searches up this thread:
I went to the Class Wizard and selected tree view class (in my case CViewTree) under Class Name. Then under Messages I found the WM_LBUTTONDBLCLCK message and clicked the 'add handler' button. This added a line to my message map and a OnLButtonDblClk function to the class, which I could put the following in:
HTREEITEM clicked = HitTest(point, &uFlags);
Where the clicked variable is now the item on the list that was clicked.
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!