Use GetItemCount() on ListCtrls instead of directly accessing ItemCount.