当前位置:网站首页>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;
}
边栏推荐
- Solution: intelligent site intelligent inspection scheme video monitoring system
- 软件开发的一点随记
- "Designer universe": "benefit dimension" APEC public welfare + 2022 the latest slogan and the new platform will be launched soon | Asia Pacific Financial Media
- Asia Pacific Financial Media | designer universe | Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers
- In the era of digital economy, how to ensure security?
- P3047 [USACO12FEB]Nearby Cows G(树形dp)
- 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
- 2.10transfrom attribute
- Pangolin Library: control panel, control components, shortcut key settings
- onie支持pice硬盘
猜你喜欢
The Vice Minister of the Ministry of industry and information technology of "APEC industry +" of the national economic and information technology center led a team to Sichuan to investigate the operat
[untitled]
National economic information center "APEC industry +": economic data released at the night of the Spring Festival | observation of stable strategy industry fund
Pangolin Library: control panel, control components, shortcut key settings
Go learning notes (3) basic types and statements (2)
Apache middleware vulnerability recurrence
File upload of DVWA range
[t31zl intelligent video application processor data]
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
. Net 6 learning notes: what is NET Core
随机推荐
649. Dota2 Senate
Data governance: misunderstanding sorting
Epoll and IO multiplexing of redis
Force buckle day31
Circuit breaker: use of hystrix
Asia Pacific Financial Media | art cube of "designer universe": Guangzhou community designers achieve "great improvement" in urban quality | observation of stable strategy industry fund
What are the ways to download network pictures with PHP
HTTP cache, forced cache, negotiated cache
flask返回文件下载
MEX有关的学习
数字经济时代,如何保障安全?
洛谷P1836 数页码 题解
1015 reversible primes (20 points) prime d-ary
解决方案:智慧工地智能巡檢方案視頻監控系統
edge瀏覽器 路徑獲得
(lightoj - 1410) consistent verbs (thinking)
861. Score after flipping the matrix
数据治理:数据质量篇
Cf1036c class numbers solution
http缓存,强制缓存,协商缓存