--以上来自百度
1.定义NOTIFY消息
#define NM_MOUSEUP (NM_FIRST-25)
2.定义结构(任意结构)
typedef struct tagNMLVSELFDEFINEDATA
{
NMHDR hdr;
int iStatus;
PVOID myData;
} NMLVSELFDEFINEDATA, *LPNMLVSELFDEFINEDATA;
3.发送NOTIFY消息
NMLVSELFDEFINEDATA dispinfo = {0};
dispinfo.hdr.code = NM_MOUSEUP;
dispinfo.hdr.hwndFrom = m_hWnd;
dispinfo.hdr.idFrom = GetDlgCtrlID();
dispinfo.iStatus = -1;
dispinfo.myData = NULL;
::SendMessage(this->GetParent()->m_hWnd, WM_NOTIFY, GetDlgCtrlID(), (LPARAM) &dispinfo);
4.接收控件ON_NOTIFY消息
BEGIN_MESSAGE_MAP(TF_PhotoGroupDlg, CDialog)
//{{AFX_MSG_MAP(TF_PhotoGroupDlg)
ON_NOTIFY(NM_MOUSEUP, IDC_LIST_PHOTO, OnMouseUpListPhoto)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
5..h中设置OnMouseUpListPhoto
//{{AFX_MSG(TF_PhotoGroupDlg)
afx_msg void OnMouseUpListPhoto(NMHDR* pNMHDR, LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
6.CPP中设置消息
void TF_PhotoGroupDlg::OnMouseUpListPhoto(NMHDR* pNMHDR, LRESULT* pResult)
{
}
结束。
联系人:徐经理
手机:13907330718
电话:0731-22222718
邮箱:hniatcom@163.com
地址: 湖南省株洲市石峰区联诚路79号轨道智谷2号倒班房6楼603室