Thread: Listview Entry Associating an Item Pointer

  1. #1
    Registered User
    Join Date
    Apr 2004

    Listview Entry Associating an Item Pointer


    Wonder if anyone can shed any light on this..

    Ive recently switched from using Standard List boxes to experimenting in List Views (Note this is non-mfc and a C/API combination)

    My question is can I associate a pointer to an item in List View like I can do with a call like this with a List Box.

    SendDlgItemMessage(DialogWindow, IDC_LIST, LB_SETITEMDATA, index_id, (LPARAM)new_node);
    Currently I can only seem to add strings and pull out strings. I need to store some ID Numbers which the user doesnt need to see related to each entry in my List View.

    Ive checked MSDN although the only thing I can find is LVM_SETITEM which doesnt allow me to do what I was originally doing with the standard List Box.

    If anyone could point me in the right direction I would appreciate it.

    Thanks in advance.


  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    You use the lParam member of LVITEM.
    Use LVM_SETITEM and LVM_GETITEM with the LVIF_PARAM mask.


  3. #3
    Registered User
    Join Date
    Apr 2004
    Ahh splendid.

    Thank you very much.


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why does C need pointer conversion
    By password636 in forum C Programming
    Replies: 2
    Last Post: 04-10-2009, 07:33 AM
  2. Replies: 5
    Last Post: 04-04-2009, 03:45 AM
  3. help! Placement of nodes in a Linked List
    By lostmyshadow in forum C Programming
    Replies: 6
    Last Post: 12-17-2007, 01:21 PM
  4. Replies: 6
    Last Post: 07-10-2006, 12:05 AM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM