Listview Entry Associating an Item Pointer

This is a discussion on Listview Entry Associating an Item Pointer within the Windows Programming forums, part of the Platform Specific Boards category; Hello, Wonder if anyone can shed any light on this.. Ive recently switched from using Standard List boxes to experimenting ...

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    21

    Listview Entry Associating an Item Pointer

    Hello,

    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.

    Code:
    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.

    Stan

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

    gg

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

    Thank you very much.

    Stan

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, 12: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 Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21