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. CListCtrl question

CListCtrl question

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

    I have created a custom, called CCustomListCtrl that inherits from CListCtrl. The only reason for this was to use the CustomDraw features. I am using this CCustomCtrl in a dialog box and I have created it dynamically as following: DWORD dwStyle; dwStyle = LVS_REPORT | WS_VISIBLE | WS_CHILD | WS_HSCROLL | WS_VSCROLL | WS_BORDER | LVS_SINGLESEL ; m_ControllerList.Create(dwStyle, CRect(nLeft, nTop, nRight, nBottom), this, IDC_CONTROLLER_LIST); m_ControllerList.SetExtendedStyle(LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP); Now, I don't have trouble catching any of the messages pertaining to the list within the CDialog class but it seems like messages pertaining to the header of the list (i.e. ColumnClick, etc) are all going to the CCustomCtrl file and I just don't seem to be able to trap them in my dialog class. any ideas?

    T M 2 Replies Last reply
    0
    • R RK_2000

      I have created a custom, called CCustomListCtrl that inherits from CListCtrl. The only reason for this was to use the CustomDraw features. I am using this CCustomCtrl in a dialog box and I have created it dynamically as following: DWORD dwStyle; dwStyle = LVS_REPORT | WS_VISIBLE | WS_CHILD | WS_HSCROLL | WS_VSCROLL | WS_BORDER | LVS_SINGLESEL ; m_ControllerList.Create(dwStyle, CRect(nLeft, nTop, nRight, nBottom), this, IDC_CONTROLLER_LIST); m_ControllerList.SetExtendedStyle(LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP); Now, I don't have trouble catching any of the messages pertaining to the list within the CDialog class but it seems like messages pertaining to the header of the list (i.e. ColumnClick, etc) are all going to the CCustomCtrl file and I just don't seem to be able to trap them in my dialog class. any ideas?

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      List control header's ID is zero. If you add handlers with ClassWizard, the message map entry will have control ID of your list, not zero. You'll have to change the ID value in message map or override OnNotify. RK_2000 wrote: I have created a custom, called CCustomListCtrl that inherits from CListCtrl. The only reason for this was to use the CustomDraw features. You can use custom draw without creating new CListCtrl-based class. Message reflection makes it possible - handler will be created in dialog class and invoked whenever list needs painting. Tomasz Sowinski -- http://www.shooltz.com

      To some its a six-pack, to me it's a support group

      1 Reply Last reply
      0
      • R RK_2000

        I have created a custom, called CCustomListCtrl that inherits from CListCtrl. The only reason for this was to use the CustomDraw features. I am using this CCustomCtrl in a dialog box and I have created it dynamically as following: DWORD dwStyle; dwStyle = LVS_REPORT | WS_VISIBLE | WS_CHILD | WS_HSCROLL | WS_VSCROLL | WS_BORDER | LVS_SINGLESEL ; m_ControllerList.Create(dwStyle, CRect(nLeft, nTop, nRight, nBottom), this, IDC_CONTROLLER_LIST); m_ControllerList.SetExtendedStyle(LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP); Now, I don't have trouble catching any of the messages pertaining to the list within the CDialog class but it seems like messages pertaining to the header of the list (i.e. ColumnClick, etc) are all going to the CCustomCtrl file and I just don't seem to be able to trap them in my dialog class. any ideas?

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

        RK_2000 wrote: it seems like messages pertaining to the header of the list (i.e. ColumnClick, etc) are all going to the CCustomCtrl file That's how WM_NOTIFY works. A notification sent by a control (in this case, the header) goes to the control's parent (the list). --Mike-- Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer My really out-of-date homepage Sonork-100.19012 Acid_Helm

        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