怎样用SendMessage发送LVN_COLUMNCLICK消息?

清泛原创
SendMessage(WM_NOTIFY, CtrlID, NM_LISTVIEW);

部分代码示例如下:
BOOL ClickListColumn(CListCtrl& listCtrl, int index)
{
        if(index >= listCtrl.GetHeaderCtrl()->GetItemCount())
            return FALSE;

        NM_LISTVIEW nmListView;
        memset(&nmListView, 0, sizeof(nmListView));
        nmListView.iItem = -1;//NOT USED IN HERE
        nmListView.iSubItem = index;//INDEX VALUE
        nmListView.hdr.hwndFrom = listCtrl.GetSafeHwnd();
        nmListView.hdr.idFrom = listCtrl.GetDlgCtrlID();
        nmListView.hdr.code = LVN_COLUMNCLICK;

        return SendMessage(WM_NOTIFY, listCtrl.GetDlgCtrlID(), (LPARAM)&nmListView);
}

SendMessage LVN_COLUMNCLICK

分享到:
评论加载中,请稍后...
创APP如搭积木 - 创意无限,梦想即时!
回到顶部