Thread: List View column

  1. #1

    List View column

    I have a list view control that currently has 3 columns (File Name, Directory, Value). I would like to add a 4th column that would hold information about the file, but I don't want to display that information. In other words, I would like to have an invisible column. My question is this: Is there a way to have an invisible column in a list view control?

    Thanks in advance

  2. #2
    Registered User
    Join Date
    Nov 2001
    I do not see the need for an "invisible" column. If you want to store data and not have the users see the data, then store the data into a data structure such as vector, list, etc. of strings.


  3. #3
    Registered User johnnie2's Avatar
    Join Date
    Aug 2001
    The LVITEM struct includes a 32-bit LPARAM value that could act as storage space for an int (or lesser data type, such as char) or pointer since both will fit into the four byte space. The only problem with this approach is that the lparam is sent to the application's comparison function by the view if you sort items, meaning you may be forced to sacrifice this functionality if you used this feature.

    So, you could copy your additional information into a buffer and store a pointer in lparam, eliminating the need to keep track of another whole vector, queue, stack, etc.
    "Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 26
    Last Post: 07-05-2010, 10:43 AM
  2. urgent help please...
    By peter_hii in forum C++ Programming
    Replies: 11
    Last Post: 10-30-2006, 06:37 AM
  3. Replies: 6
    Last Post: 03-02-2005, 02:45 AM
  4. problem with structures and linked list
    By Gkitty in forum C Programming
    Replies: 6
    Last Post: 12-12-2002, 06:40 PM
  5. List class
    By SilasP in forum C++ Programming
    Replies: 0
    Last Post: 02-10-2002, 05:20 PM