清泛IT社区
标题:
怎样用SendMessage发送LVN_COLUMNCLICK消息?
[打印本页]
作者:
清泛网
时间:
2016-05-17 11:44
标题:
怎样用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);
}
复制代码
欢迎光临 清泛IT社区 (https://bbs.tsingfun.com/)
Powered by Discuz! X3.3