By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,655 Members | 962 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,655 IT Pros & Developers. It's quick & easy.

Getting number of columns in ListView

tbarto
P: 19
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
Feb 22 '07 #1
Share this Question
Share on Google+
1 Reply


tbarto
P: 19
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.
Feb 26 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.