当前位置:网站首页>MFC 给列表控件发送左键单击、双击、以及右键单击消息
MFC 给列表控件发送左键单击、双击、以及右键单击消息
2022-07-06 07:50:00 【donghuangliuyun】
void CTestsetting::SendClickToList()
{
NMITEMACTIVATE NMItemActive;
NMHDR thdr;
thdr.code = NM_CLICK; //NM_CLICK单击 NM_DBLCKL 双击 NM_RCLICK右键单击
thdr.hwndFrom = m_TestsetList.m_hWnd; //m_TestList是列表控件关联的变量
thdr.idFrom = IDC_TESTSETTING_LIST; //IDC_TESTSETTING_LIST 列表控件ID
NMItemActive.hdr = thdr;
NMItemActive.iItem = m_TestsetList.GetItemCount();
NMItemActive.iItem = 0; //设置选中第几行
NMItemActive.iSubItem = 1; //设置选中第几列
m_TestsetList.SetSelectionMark(0);
SendMessage(WM_NOTIFY, IDC_TESTSETTING_LIST, (LPARAM)&NMItemActive); //把消息发送给列表所在地父窗口,由父窗口转发,而不是直接转发给列表
}
添加列表左键单击响应函数
void CTestsetting::OnNMClickTestsettingList(NMHDR* pNMHDR, LRESULT* pResult)
{
//因为是测试所以是随便写的变量
LPNMITEMACTIVATE temp = (LPNMITEMACTIVATE)pNMHDR;//将传进来的消息转换成LPNMITEMACTIVAT
int nItem = temp->iItem;//获得行号
int nSubItem = temp->iSubItem;//获得列号
TRACE("%d, %d\n", nItem, nSubItem);
*pResult = 0;
}
边栏推荐
- Risk planning and identification of Oracle project management system
- datax自检报错 /datax/plugin/reader/._drdsreader/plugin.json]不存在
- jmeter性能测试步骤实战教程
- 2.10transfrom attribute
- 洛谷P1836 数页码 题解
- 数据治理:元数据管理篇
- Solution: intelligent site intelligent inspection scheme video monitoring system
- Scala语言学习-08-抽象类
- Redis list detailed explanation of character types yyds dry goods inventory
- Entity class design for calculating age based on birthday
猜你喜欢

Inspiration from the recruitment of bioinformatics analysts in the Department of laboratory medicine, Zhujiang Hospital, Southern Medical University
![[cf gym101196-i] waif until dark network maximum flow](/img/66/6b339fc23146b5fbdcd2a1fa0a2349.png)
[cf gym101196-i] waif until dark network maximum flow

jmeter性能测试步骤实战教程
![[CF Gym101196-I] Waif Until Dark 网络最大流](/img/66/6b339fc23146b5fbdcd2a1fa0a2349.png)
[CF Gym101196-I] Waif Until Dark 网络最大流

JMeter performance test steps practical tutorial

leecode-C語言實現-15. 三數之和------思路待改進版

How to prevent Association in cross-border e-commerce multi account operations?

合规、高效,加快药企数字化转型,全新打造药企文档资源中心

Pangolin Library: control panel, control components, shortcut key settings

opencv学习笔记九--背景建模+光流估计
随机推荐
WebRTC系列-H.264预估码率计算
Ali's redis interview question is too difficult, isn't it? I was pressed on the ground and rubbed
1015 reversible primes (20 points) prime d-ary
datax自检报错 /datax/plugin/reader/._drdsreader/plugin.json]不存在
Force buckle day31
【T31ZL智能视频应用处理器资料】
洛谷P1836 数页码 题解
软件开发的一点随记
Le chemin du navigateur Edge obtient
Do you really think binary search is easy
TS 类型体操 之 循环中的键值判断,as 关键字使用
[computer skills]
链表面试题(图文详解)
数据治理:微服务架构下的数据治理
[window] when the Microsoft Store is deleted locally, how to reinstall it in three steps
MEX有关的学习
How to prevent Association in cross-border e-commerce multi account operations?
Cf1036c class numbers solution
Luogu p4127 [ahoi2009] similar distribution problem solution
Opencv learning notes 8 -- answer sheet recognition