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. how to retrieve llist data from CListCtrl::OnNMRclick(NMHDR *pNMHDR, LRESULT *pResult)

how to retrieve llist data from CListCtrl::OnNMRclick(NMHDR *pNMHDR, LRESULT *pResult)

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelptutorial
4 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.
  • Z Offline
    Z Offline
    zecodela
    wrote on last edited by
    #1

    hi, i want to know how i can get back the data from click event of the list control? i received a these 2 pointers, (NMHDR *pNMHDR, LRESULT *pResult). i think i need to have a typecast to get back my data. how can i get the position i click on the list so that i can get back my data from CListCtrl::GetItem() or CListCtrl::GetItemData()? any help? thanks?

    A 1 Reply Last reply
    0
    • Z zecodela

      hi, i want to know how i can get back the data from click event of the list control? i received a these 2 pointers, (NMHDR *pNMHDR, LRESULT *pResult). i think i need to have a typecast to get back my data. how can i get the position i click on the list so that i can get back my data from CListCtrl::GetItem() or CListCtrl::GetItemData()? any help? thanks?

      A Offline
      A Offline
      Aamir Butt
      wrote on last edited by
      #2

      You have to call HitTest() function to check which item of List Control is hit. After getting Handle to that item, you can do whatever you want. You can find Articles here on CodeProject for this. Sorry, I am too tired to search for those. You have to do it yourself.:zzz: Imagine that you are creating a fabric of human destiny with the object of making men happy in the end, giving them peace and rest at last, but that it was essential and inevitable to torture to death only one tiny creature..and to found that edifice on its unavenged tears, would you consent to be the architect on those conditions? Tell me, and tell me the truth! -Fyodor Dostoevsky, The Brothers Karamazov

      D 1 Reply Last reply
      0
      • A Aamir Butt

        You have to call HitTest() function to check which item of List Control is hit. After getting Handle to that item, you can do whatever you want. You can find Articles here on CodeProject for this. Sorry, I am too tired to search for those. You have to do it yourself.:zzz: Imagine that you are creating a fabric of human destiny with the object of making men happy in the end, giving them peace and rest at last, but that it was essential and inevitable to torture to death only one tiny creature..and to found that edifice on its unavenged tears, would you consent to be the architect on those conditions? Tell me, and tell me the truth! -Fyodor Dostoevsky, The Brothers Karamazov

        D Offline
        D Offline
        Dudi Avramov
        wrote on last edited by
        #3

        Try casting to LPNMLISTVIEW: LPNMLISTVIEW p = (LPNMLISTVIEW) pNMHDR;

        Z 1 Reply Last reply
        0
        • D Dudi Avramov

          Try casting to LPNMLISTVIEW: LPNMLISTVIEW p = (LPNMLISTVIEW) pNMHDR;

          Z Offline
          Z Offline
          zecodela
          wrote on last edited by
          #4

          oh! i solved the problem. thank you very much! actually, how can u get this? i can't get any hints from MSDN library.

          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