Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Tree Control

Tree Control

Scheduled Pinned Locked Moved C / C++ / MFC
data-structures
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vu Nguyen
    wrote on last edited by
    #1

    Hi all! How do we know what branch of the tree (CTreeCtrl) is clicked on. Thank You Vu vucsuf

    P 1 Reply Last reply
    0
    • V Vu Nguyen

      Hi all! How do we know what branch of the tree (CTreeCtrl) is clicked on. Thank You Vu vucsuf

      P Offline
      P Offline
      Paolo Messina
      wrote on last edited by
      #2

      Can this help?

      void CMyTreeCtrl::OnRightClick(NMHDR* /*pNMHDR*/, LRESULT* pResult)
      {
      CPoint point(GetMessagePos());
      ScreenToClient(&point);
      HTREEITEM hItem = HitTest(point, &nFlags);
      //...
      }

      Paolo ------ "airplane is cool, but space shuttle is even better" (J. Kaczorowski)

      V C 2 Replies Last reply
      0
      • P Paolo Messina

        Can this help?

        void CMyTreeCtrl::OnRightClick(NMHDR* /*pNMHDR*/, LRESULT* pResult)
        {
        CPoint point(GetMessagePos());
        ScreenToClient(&point);
        HTREEITEM hItem = HitTest(point, &nFlags);
        //...
        }

        Paolo ------ "airplane is cool, but space shuttle is even better" (J. Kaczorowski)

        V Offline
        V Offline
        Vu Nguyen
        wrote on last edited by
        #3

        Thanks! Vu vucsuf

        1 Reply Last reply
        0
        • P Paolo Messina

          Can this help?

          void CMyTreeCtrl::OnRightClick(NMHDR* /*pNMHDR*/, LRESULT* pResult)
          {
          CPoint point(GetMessagePos());
          ScreenToClient(&point);
          HTREEITEM hItem = HitTest(point, &nFlags);
          //...
          }

          Paolo ------ "airplane is cool, but space shuttle is even better" (J. Kaczorowski)

          C Offline
          C Offline
          Chambers
          wrote on last edited by
          #4

          Not really, I`m looking more for a straight conversion from a CString class to a CPoint class if its possible, by thanks for taking to the time to have a go, I appreciate that Paolo. Alan. AEGC

          P 1 Reply Last reply
          0
          • C Chambers

            Not really, I`m looking more for a straight conversion from a CString class to a CPoint class if its possible, by thanks for taking to the time to have a go, I appreciate that Paolo. Alan. AEGC

            P Offline
            P Offline
            Paolo Messina
            wrote on last edited by
            #5

            I'm not sure of what you're trying to do, but if you want to know where an item is, just call GetItemRect(). Paolo ------ "airplane is cool, but space shuttle is even better" (J. Kaczorowski)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups