[RESOLVED] clicking in a CDockablePane
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: [RESOLVED] clicking in a CDockablePane

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Posts
    47

    [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?

  2. #2
    Join Date
    Aug 2010
    Posts
    47

    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:

    UINT uFlags;
    HTREEITEM clicked = HitTest(point, &uFlags);

    Where the clicked variable is now the item on the list that was clicked.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center