VC listctrl control Get column count
(in a CListCtrl class)
HWND hwHeaderCtrl; int nColumnCount; hwHeaderCtrl = (HWND)this->SendMessage(LVM_GETHEADER, 0, 0); if (hwHeaderCtrl != NULL) { nColumnCount = ::SendMessage(hwHeaderCtrl, HDM_GETITEMCOUNT, 0, 0); }