Announcement

Collapse
No announcement yet.

Notifications on a Listview

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Notifications on a Listview

    According MSDN documentation a %NM_HOVER notification is sent by a listview control when the mouse hovers over an item. This notification message is sent in the form of a %WM_NOTIFY message.
    After multiple tests, with PB 9.01 and Windows Vista, I don't able to receive this notification. At this moment I'm very confused and don't know were is the mistake or perhaps if it is a false understanding.
    There is someone who has experienced with this notification?

    Regards
    Jordi

  • #2
    Code? SDK? DDT? Hybrid (DDT dialog using ''CONTROL ADD "syslistview32"')? Do you get other WM_NOTIFY messages?

    May we buy a vowel? Call a friend?

    (translation: "show failing code")
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Ok, now that I see that this refers to your source code post at http://www.powerbasic.com/support/pb...ad.php?t=40454....

      Try adding style LVS_EX_FULLROWSELECT to your control.

      That does have the unfortunate visual side effect of, well, selecting the whole row, but you could overcome that by ownerdrawing on WM_NOTIFY/NM_CUSTOMDRAW (if allowed with the DDT-managed LISTVIEW).
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        The origin of this incident (or perhaps my problem) started with the ToolTips and ListView demo program post on Source Code forum http://www.powerbasic.com/support/pb...ad.php?t=40454.
        To have a tooltip on an item of first column is very easy because a %LVN_GETINFOTIP notification is prepared for that. But to have tooltips on the rest of subitems two ways are possible, controlling the mouse pointer directly by %WM_MOUSEMOVE or similar notification, or, according MSDN documentation, with %NM_HOVER but never I reveived this notification.

        That happens on DDT and SDK, even DDT with hybrid combinations.

        Jordi

        Comment


        • #5
          Extended style %LVS_EX_FULLROWSELECT was added at beginning without success.

          Jordi
          Last edited by Jordi Vallès; 27 Jun 2009, 01:22 PM. Reason: Correction

          Comment


          • #6
            Is it possible the WM_NOTIFY/NM_HOVER is sent by the TOOLTIP (hWndFrom=hWndToolTip) rather than the listview control?

            Or...maybe.....
            Code:
              WM_NOTIFY 
                 LVN_GETINFOTIP 
                         GetCursorPos
                         ScreenToClient
                         Listview_HitTest 
                         text =  text based on item AND subitem
            ???
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              Field iSubItem of NMLVGETINFOTIP structure that is pointed by LParam when %LVN_GETINFOTIP notification is received is not currently used and will always be zero. That is, only valid for first column.

              About your suggestion to investigate if the control is the tooltip instead of listview control needs more research and testing but I think this notification is under the listview control documentation. I must investigate. We report the results.

              Thanks for your interest Michael.

              Jordi

              Set vowels as needed.

              Comment


              • #8
                Field iSubItem of NMLVGETINFOTIP structure that is pointed by LParam when %LVN_GETINFOTIP notification is received is not currently used and will always be zero. That is, only valid for first column
                That's why I suggested you find out where the cursor is yourself, using ListView_HitTest
                Michael Mattias
                Tal Systems (retired)
                Port Washington WI USA
                [email protected]
                http://www.talsystems.com

                Comment


                • #9
                  ListView_HitTest provides information after a click, no before. In any case I have this problem solved tracking, by hand, the mouse on listview window, but the original question at beginning of this thread remains unanswered and it's a pity because seems the most elegant solution.

                  Jordi

                  Comment


                  • #10
                    In a listview, the NM_HOVER notification is not sent unless the LVN_HOTTRACK notification is defined as well as the LVS_EX_TRACKSELECT extended style.

                    Note that LVN_HOTTRACK is sent continuously as the mouse pointer is moved across an item, but the NM_HOVER is sent once the mouse pointer pauses.

                    Whether LVS_EX_FULLROWSELECT is set or not is not relevant here.

                    What is interesting is that NM_HOVER is not sent until some other notification is sent, such as LVN_GETINFOTIP or NM_CLICK. i.e. moving the mouse pointer over a listview item does not send the hover notification until the listview has been clicked, or a tooltip message is sent.

                    As you are aware, the LVN_GETINFOTIP notification is sent only for the first column and not for any sub-items.

                    Comment


                    • #11
                      Finally, after some research, I decided create and display tooltips for all items and subitems using %NM_CUSTOMDRAW notification.
                      Information found on Internet about NM_HOVER is some confused and even has several user complaints
                      See my new sample LVdemo4 on Source Code forum.

                      Thanks Michael and Christopher
                      Jordi

                      Comment

                      Working...
                      X