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. Get LVN_MARQUEEBEGIN in CListCtrl

Get LVN_MARQUEEBEGIN in CListCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
question
12 Posts 3 Posters 40 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.
  • L Li Lin 2023

    I have a class inherited from CListCtrl. Why I didn't get LVN_MARQUEEBEGIN notification in the method OnNotify() of my class when clicking and dragging??? :( :( :(

    BOOL CListCtrlEx::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT*
    pResult)
    {
    LPNMLISTVIEW pnmv = (LPNMLISTVIEW)lParam;

    switch(pnmv->hdr.code){
      case LVN\_MARQUEEBEGIN:
        ; // Deal with some case here.
      break;
    }
    
    return CListCtrl::OnNotify(wParam, lParam, pResult);
    

    }

    V Offline
    V Offline
    Victor Nijegorodov
    wrote on last edited by
    #2

    Could these discussion help you? [https://stackoverflow.com/questions/56977766/how-to-implement-multiple-selection-in-listview-with-lvn-marqueebegin\](https://stackoverflow.com/questions/56977766/how-to-implement-multiple-selection-in-listview-with-lvn-marqueebegin) [https://stackoverflow.com/questions/56619044/clistctrl-select-multiple-lines-with-the-mouse\](https://stackoverflow.com/questions/56619044/clistctrl-select-multiple-lines-with-the-mouse)

    L 1 Reply Last reply
    0
    • V Victor Nijegorodov

      Could these discussion help you? [https://stackoverflow.com/questions/56977766/how-to-implement-multiple-selection-in-listview-with-lvn-marqueebegin\](https://stackoverflow.com/questions/56977766/how-to-implement-multiple-selection-in-listview-with-lvn-marqueebegin) [https://stackoverflow.com/questions/56619044/clistctrl-select-multiple-lines-with-the-mouse\](https://stackoverflow.com/questions/56619044/clistctrl-select-multiple-lines-with-the-mouse)

      L Offline
      L Offline
      Li Lin 2023
      wrote on last edited by
      #3

      I have noted those discussion before, no clue..

      V 1 Reply Last reply
      0
      • L Li Lin 2023

        I have a class inherited from CListCtrl. Why I didn't get LVN_MARQUEEBEGIN notification in the method OnNotify() of my class when clicking and dragging??? :( :( :(

        BOOL CListCtrlEx::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT*
        pResult)
        {
        LPNMLISTVIEW pnmv = (LPNMLISTVIEW)lParam;

        switch(pnmv->hdr.code){
          case LVN\_MARQUEEBEGIN:
            ; // Deal with some case here.
          break;
        }
        
        return CListCtrl::OnNotify(wParam, lParam, pResult);
        

        }

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #4

        Without seeing some of your code it is impossible to guess.

        L 1 Reply Last reply
        0
        • L Li Lin 2023

          I have noted those discussion before, no clue..

          V Offline
          V Offline
          Victor Nijegorodov
          wrote on last edited by
          #5

          Then perhaps you'll describe how you are doing the "dragging" anw how and in what class you are handling this notification... :suss:

          L 1 Reply Last reply
          0
          • V Victor Nijegorodov

            Then perhaps you'll describe how you are doing the "dragging" anw how and in what class you are handling this notification... :suss:

            L Offline
            L Offline
            Li Lin 2023
            wrote on last edited by
            #6

            Click the left button, hold on it and move the mouse to somewhere else, no any message receive... My codes as below:

            BOOL CListCtrlEx::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT*
            pResult)
            {
            LPNMLISTVIEW pnmv = (LPNMLISTVIEW)lParam;

            switch(pnmv->hdr.code){
                case LVN\_MARQUEEBEGIN: 
                ; // Deal with some case here.
                break;
            }
            
            return CListCtrl::OnNotify(wParam, lParam, pResult);
            

            }

            This method is trigged only when move mouse into the dialog which contains CListCtrlEx object, message type is TTN_GETDISPINFOW.

            V 1 Reply Last reply
            0
            • L Lost User

              Without seeing some of your code it is impossible to guess.

              L Offline
              L Offline
              Li Lin 2023
              wrote on last edited by
              #7

              Updated my question, added related codes.

              L 1 Reply Last reply
              0
              • L Li Lin 2023

                Updated my question, added related codes.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #8

                Where is the MFC ON_NOTIFY table that defines the captures? Note also that the notification goes first to the list control's parent window, so you need to capture it there.

                1 Reply Last reply
                0
                • L Li Lin 2023

                  Click the left button, hold on it and move the mouse to somewhere else, no any message receive... My codes as below:

                  BOOL CListCtrlEx::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT*
                  pResult)
                  {
                  LPNMLISTVIEW pnmv = (LPNMLISTVIEW)lParam;

                  switch(pnmv->hdr.code){
                      case LVN\_MARQUEEBEGIN: 
                      ; // Deal with some case here.
                      break;
                  }
                  
                  return CListCtrl::OnNotify(wParam, lParam, pResult);
                  

                  }

                  This method is trigged only when move mouse into the dialog which contains CListCtrlEx object, message type is TTN_GETDISPINFOW.

                  V Offline
                  V Offline
                  Victor Nijegorodov
                  wrote on last edited by
                  #9

                  I added the message handler for LVN_MARQUEEBEGIN in my CListCtrl derived class:

                  BEGIN_MESSAGE_MAP(CListOptionsCtrl, CListCtrl)
                  ON_NOTIFY_REFLECT(LVN_MARQUEEBEGIN, &CListOptionsCtrl::OnLvnMarqueeBegin)
                  ...
                  void CListOptionsCtrl::OnLvnMarqueeBegin(NMHDR* pNMHDR, LRESULT* pResult)
                  {
                  LPNMLISTVIEW pNMLV = reinterpret_cast(pNMHDR);
                  // TODO: Add your control notification handler code here
                  *pResult = 0;
                  }

                  and it does work. :suss:

                  1 Reply Last reply
                  0
                  • L Li Lin 2023

                    I have a class inherited from CListCtrl. Why I didn't get LVN_MARQUEEBEGIN notification in the method OnNotify() of my class when clicking and dragging??? :( :( :(

                    BOOL CListCtrlEx::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT*
                    pResult)
                    {
                    LPNMLISTVIEW pnmv = (LPNMLISTVIEW)lParam;

                    switch(pnmv->hdr.code){
                      case LVN\_MARQUEEBEGIN:
                        ; // Deal with some case here.
                      break;
                    }
                    
                    return CListCtrl::OnNotify(wParam, lParam, pResult);
                    

                    }

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #10

                    Li Lin 2023 wrote:

                    BOOL CListCtrlEx::OnNotify

                    You cannot capture it there. You will need to use [ON_NOTIFY_REFLECT](https://learn.microsoft.com/en-us/cpp/mfc/tn062-message-reflection-for-windows-controls?view=msvc-170) if you want to capture LVN_MARQUEEBEGIN in your CListCtrl derived class. Or as Richard pointed out you can capture that message in the parent window.

                    L 1 Reply Last reply
                    0
                    • L Lost User

                      Li Lin 2023 wrote:

                      BOOL CListCtrlEx::OnNotify

                      You cannot capture it there. You will need to use [ON_NOTIFY_REFLECT](https://learn.microsoft.com/en-us/cpp/mfc/tn062-message-reflection-for-windows-controls?view=msvc-170) if you want to capture LVN_MARQUEEBEGIN in your CListCtrl derived class. Or as Richard pointed out you can capture that message in the parent window.

                      L Offline
                      L Offline
                      Li Lin 2023
                      wrote on last edited by
                      #11

                      Got it, thank you!

                      L 1 Reply Last reply
                      0
                      • L Li Lin 2023

                        Got it, thank you!

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #12

                        Good job, happy to see you solved it.

                        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