Loading... ![image.png](http://www.irohane.top/usr/uploads/2021/02/2844989659.png) ![image.png](http://www.irohane.top/usr/uploads/2021/02/465677681.png) ![image.png](http://www.irohane.top/usr/uploads/2021/02/3005351427.png) ![image.png](http://www.irohane.top/usr/uploads/2021/02/1974882440.png)![image.png](http://www.irohane.top/usr/uploads/2021/02/499495727.png) ``` void D_Process::OnNMRClickList1(NMHDR* pNMHDR, LRESULT* pResult) { LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR); // TODO: 在此添加控件通知处理程序代码 CMenu menu; menu.LoadMenuW(IDR_MENU1); //菜单ID CPoint point; GetCursorPos(&point); CMenu* Cmenu = menu.GetSubMenu(0); //这里的0 要设置为菜单的第几列 Cmenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this); *pResult = 0; } int num = (int)l_ServiceInfo.GetFirstSelectedItemPosition() - 1; CString csServiceName = l_ServiceInfo.GetItemText(num, 0); ----------------------------------------------如果获取不到注意这只列表风格 MyList.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_CHECKBOXES); ``` 创建响应 ![image.png](http://www.irohane.top/usr/uploads/2021/02/2021096407.png) ![image.png](http://www.irohane.top/usr/uploads/2021/02/1958460651.png) 绑定控件ID 响应消息为RepFunc函数 ![image.png](http://www.irohane.top/usr/uploads/2021/02/4173308259.png) PID传输为控件ID ![image.png](http://www.irohane.top/usr/uploads/2021/02/457320458.png) ![image.png](http://www.irohane.top/usr/uploads/2021/02/2528295023.png) ![image.png](http://www.irohane.top/usr/uploads/2021/02/3986756246.png) 最后修改:2021 年 02 月 26 日 © 允许规范转载 赞 0 如果觉得我的文章对你有用,请随意赞赏