当前位置:网站首页>MFC sends left click, double click, and right click messages to list controls
MFC sends left click, double click, and right click messages to list controls
2022-07-06 07:58:00 【donghuangliuyun】
void CTestsetting::SendClickToList()
{
NMITEMACTIVATE NMItemActive;
NMHDR thdr;
thdr.code = NM_CLICK; //NM_CLICK single click NM_DBLCKL double-click NM_RCLICK Right click
thdr.hwndFrom = m_TestsetList.m_hWnd; //m_TestList Is the variable associated with the list control
thdr.idFrom = IDC_TESTSETTING_LIST; //IDC_TESTSETTING_LIST List control ID
NMItemActive.hdr = thdr;
NMItemActive.iItem = m_TestsetList.GetItemCount();
NMItemActive.iItem = 0; // Set the selected row
NMItemActive.iSubItem = 1; // Set the selected column
m_TestsetList.SetSelectionMark(0);
SendMessage(WM_NOTIFY, IDC_TESTSETTING_LIST, (LPARAM)&NMItemActive); // Send the message to the parent window where the list is located , Forwarded by the parent window , Instead of forwarding directly to the list
}
Add list left click response function
void CTestsetting::OnNMClickTestsettingList(NMHDR* pNMHDR, LRESULT* pResult)
{
// Because it is a test, it is a variable written casually
LPNMITEMACTIVATE temp = (LPNMITEMACTIVATE)pNMHDR;// Convert the incoming message into LPNMITEMACTIVAT
int nItem = temp->iItem;// Get line number
int nSubItem = temp->iSubItem;// Get column number
TRACE("%d, %d\n", nItem, nSubItem);
*pResult = 0;
}
边栏推荐
- MFC 给列表控件发送左键单击、双击、以及右键单击消息
- P3047 [usaco12feb]nearby cows g (tree DP)
- C # connect to SQLite database to read content
- MES, APS and ERP are essential to realize fine production
- Circuit breaker: use of hystrix
- 上线APS系统,破除物料采购计划与生产实际脱钩的难题
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- 好用的TCP-UDP_debug工具下载和使用
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
猜你喜欢
Nft智能合约发行,盲盒,公开发售技术实战--拼图篇
合规、高效,加快药企数字化转型,全新打造药企文档资源中心
[redis] Introduction to NoSQL database and redis
Simulation of Teman green interferometer based on MATLAB
【T31ZL智能视频应用处理器资料】
[factorial inverse], [linear inverse], [combinatorial counting] Niu Mei's mathematical problems
让学指针变得更简单(三)
"Friendship and righteousness" of the center for national economy and information technology: China's friendship wine - the "unparalleled loyalty and righteousness" of the solidarity group released th
22. Empty the table
Leetcode question brushing record | 203_ Remove linked list elements
随机推荐
Data governance: data quality
Understanding of law of large numbers and central limit theorem
Go learning notes (3) basic types and statements (2)
[t31zl intelligent video application processor data]
Parameter self-tuning of relay feedback PID controller
链表面试题(图文详解)
edge瀏覽器 路徑獲得
【T31ZL智能视频应用处理器资料】
esRally国内安装使用避坑指南-全网最新
Secure captcha (unsafe verification code) of DVWA range
Esrally domestic installation and use pit avoidance Guide - the latest in the whole network
数据治理:微服务架构下的数据治理
[factorial inverse], [linear inverse], [combinatorial counting] Niu Mei's mathematical problems
edge浏览器 路径获得
Entity class design for calculating age based on birthday
JMeter performance test steps practical tutorial
Pangolin Library: control panel, control components, shortcut key settings
Generator Foundation
Data governance: 3 characteristics, 4 transcendence and 3 28 principles of master data
解决方案:智慧工地智能巡檢方案視頻監控系統