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);
    }
posted @ 2012-06-18 23:14  特洛伊人  阅读(214)  评论(0编辑  收藏  举报