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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CListCtrl derived class not receiving WM_VSCROLL

CListCtrl derived class not receiving WM_VSCROLL

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 2 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.
  • B Offline
    B Offline
    b_girl
    wrote on last edited by
    #1

    I have a list control within a dialog box and when the user clicks on the vertical scroll bar in the control, I need something to happen within that control. I have tried to use message maps to handle the WM_VSCROLL message in both the dialog class and the CListCtrl derived class. Neither of these classes ever seem to get a WM_VSCROLL message. Does anyone know what message is sent when a user clicks on the vertical scroll bar in a list control? Thanks.

    M 1 Reply Last reply
    0
    • B b_girl

      I have a list control within a dialog box and when the user clicks on the vertical scroll bar in the control, I need something to happen within that control. I have tried to use message maps to handle the WM_VSCROLL message in both the dialog class and the CListCtrl derived class. Neither of these classes ever seem to get a WM_VSCROLL message. Does anyone know what message is sent when a user clicks on the vertical scroll bar in a list control? Thanks.

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      It is WM_VSCROLL. I assume that you've drawn a list view control in your dialog template. If you only used Attach to attach your CListCtrl-derived object, you won't get all the messages. You need to either use SubclassWindow, or you can use DDX_Control in your dialog's DoDataExchange override.

      B 1 Reply Last reply
      0
      • M Mike Dimmick

        It is WM_VSCROLL. I assume that you've drawn a list view control in your dialog template. If you only used Attach to attach your CListCtrl-derived object, you won't get all the messages. You need to either use SubclassWindow, or you can use DDX_Control in your dialog's DoDataExchange override.

        B Offline
        B Offline
        b_girl
        wrote on last edited by
        #3

        Mike Dimmick wrote: or you can use DDX_Control in your dialog's DoDataExchange override. I have used DDX_Control in my dialog's DoDataExchange override: DDX_Control(pDX, IDC_ELEMENT_LIST, m_elementList); where m_elementList is of type CElementListCtrl, my ListCtrl derived class. In CElementListCtrl I have both a function to handle the WM_VSCROLL message and an override of PreTranslateMessage() where I put in: if(pMsg->message == WM_VSCROLL) AfxMessageBox("WM_VSCROLL message received"); but that if statement never gets executed either, which leads me to believe that this message is never getting sent. I had also tried to put a function in my dialog class to handle the WM_VSCROLL message as well, just to see if the dialog class was getting the message instead of my list control, but it wasn't.

        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