Getting number of columns in ListView

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tbarto
    New Member
    • Feb 2007
    • 19

    Getting number of columns in ListView

    Hi

    For some time I've been working on an application that may be able to find a specified item in ListView ( WinAPI ). It is possible to get some item using e.g LVM_GETITEM message and LVITEM structure. My question is: Do You know any way to get a number of columns in a ListView? Is there any specified message?

    Thank You
  • tbarto
    New Member
    • Feb 2007
    • 19

    #2
    Originally posted by tbarto
    Hi

    For some time I've been working on an application that may be able to find a specified item in ListView ( WinAPI ). It is possible to get some item using e.g LVM_GETITEM message and LVITEM structure. My question is: Do You know any way to get a number of columns in a ListView? Is there any specified message?

    Thank You
    I have found a solution, but just FYI if somebody experiences a similar problem. It is necessary to use LVM_GETCOLUMN message and LPLVCOLUMN structure. Then You need to use SendMessage with LVM_GETCOLUMN and a ref to LPLVCOLUMN. Go "right" through the list and increment a counter of columns until SendMessage returns - 1.

    Comment

    Working...