Jim Burns wrote:
> I'm looking for a method to determine the number of columns in a ListView
> control via the windows API.  I realize using Delphi's
> TListView.Columns.Count works just fine but I'm puzzled by the fact that I
> can't find anyway to do this straight from windows.  
> 
> In fact I've searched the net hi and lo and keep getting stuck in language
> specific answers.  It would appear that if one is managing the
> LVM_INSERTCOLUMN and LVM_DELETECOLUMN then one might simply keep track of
> the count as well completely outside and external to the windows ListView
> itself.  I looked hard at LVM_GETCOLUMNORDERARRAY as maybe a trick to obtain
> the count but it /requires/ the count itself.  
> 
> Does anyone familiar with the API know or, for those curious enough, see a
> way to determine the count of columns?

I think the API assumption is that since you presumably built the 
ListView yourself using the API then you should already know how many 
columns you added.

In any case, at first glance the only method I can see to do it with the 
API is to enumerate the columns with the LVM_GETCOLUMN message.

HTH

Stephen Posey
[EMAIL PROTECTED]
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to