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. STOP CListCtrl selection rectangle

STOP CListCtrl selection rectangle

Scheduled Pinned Locked Moved C / C++ / MFC
question
9 Posts 3 Posters 5 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.
  • A Offline
    A Offline
    alex barylski
    wrote on last edited by
    #1

    Is there any easy way to prevent the selection rectangle from following my mouse when clicking and dragging on the CListCtrl? Without having to use OwnerDrawor CustomDraw??? Thanks! :) "Two wrongs don't make a right, but three lefts do!" - Alex Barylski :)

    M 1 Reply Last reply
    0
    • A alex barylski

      Is there any easy way to prevent the selection rectangle from following my mouse when clicking and dragging on the CListCtrl? Without having to use OwnerDrawor CustomDraw??? Thanks! :) "Two wrongs don't make a right, but three lefts do!" - Alex Barylski :)

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Add the LVS_SINGLESEL style to the control. --Mike-- When 900 years old you reach, look as good you will not. Hmm. 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

      A 1 Reply Last reply
      0
      • M Michael Dunn

        Add the LVS_SINGLESEL style to the control. --Mike-- When 900 years old you reach, look as good you will not. Hmm. 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

        A Offline
        A Offline
        alex barylski
        wrote on last edited by
        #3

        Thats the catch. I need multiple selection. CustomDraw or OwnerDraw, will that work? Thanks "Two wrongs don't make a right, but three lefts do!" - Alex Barylski :)

        M 1 Reply Last reply
        0
        • A alex barylski

          Thats the catch. I need multiple selection. CustomDraw or OwnerDraw, will that work? Thanks "Two wrongs don't make a right, but three lefts do!" - Alex Barylski :)

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          Hockey wrote: Thats the catch. I need multiple selection Ah, in that case handle the LVN_MARQUEEBEGIN notification and return TRUE to cancel the marquee. --Mike-- When 900 years old you reach, look as good you will not. Hmm. 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

          A 2 Replies Last reply
          0
          • M Michael Dunn

            Hockey wrote: Thats the catch. I need multiple selection Ah, in that case handle the LVN_MARQUEEBEGIN notification and return TRUE to cancel the marquee. --Mike-- When 900 years old you reach, look as good you will not. Hmm. 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

            A Offline
            A Offline
            alex barylski
            wrote on last edited by
            #5

            Very cool...Thanks alot Happy new years! (in about 6 morre hours) "Two wrongs don't make a right, but three lefts do!" - Alex Barylski :)

            1 Reply Last reply
            0
            • M Michael Dunn

              Hockey wrote: Thats the catch. I need multiple selection Ah, in that case handle the LVN_MARQUEEBEGIN notification and return TRUE to cancel the marquee. --Mike-- When 900 years old you reach, look as good you will not. Hmm. 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

              A Offline
              A Offline
              alex barylski
              wrote on last edited by
              #6

              Quick question Why does the following not work? :(

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

              switch(pnmv->hdr.code){
              	case LVN\_MARQUEEBEGIN: break;
              		return TRUE; // Cancel selection marquee
              }
              
              return CListCtrl::OnNotify(wParam, lParam, pResult);
              

              }

              Thanks again "Two wrongs don't make a right, but three lefts do!" - Alex Barylski :)

              M 1 Reply Last reply
              0
              • A alex barylski

                Quick question Why does the following not work? :(

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

                switch(pnmv->hdr.code){
                	case LVN\_MARQUEEBEGIN: break;
                		return TRUE; // Cancel selection marquee
                }
                
                return CListCtrl::OnNotify(wParam, lParam, pResult);
                

                }

                Thanks again "Two wrongs don't make a right, but three lefts do!" - Alex Barylski :)

                M Offline
                M Offline
                Michael Dunn
                wrote on last edited by
                #7

                You have the break in the wrong place ;) --Mike-- When 900 years old you reach, look as good you will not. Hmm. 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

                A 1 Reply Last reply
                0
                • M Michael Dunn

                  You have the break in the wrong place ;) --Mike-- When 900 years old you reach, look as good you will not. Hmm. 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

                  A Offline
                  A Offline
                  alex barylski
                  wrote on last edited by
                  #8

                  Shite...I didn't even see that... Thanks again! :) "Two wrongs don't make a right, but three lefts do!" - Alex Barylski :)

                  L 1 Reply Last reply
                  0
                  • A alex barylski

                    Shite...I didn't even see that... Thanks again! :) "Two wrongs don't make a right, but three lefts do!" - Alex Barylski :)

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

                    I have a class, named MyListCtrl which is inherited from CListCtrl. Why I didn't get LVN_MARQUEEBEGIN notification in MyListCtrl::OnNotify() when clicking and dragging??? :( :( :(

                    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