首页
IT
登录
6mi
u
盘
搜
搜 索
IT
判断按钮的点击和抬起
判断按钮的点击和抬起
xiaoxiao
2021-12-12
19
在父窗口的PretranslateMessage中拦截WM_LBUTTONDOWN和WM_LBUTTONUP进行处理:
C/C++ code
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 BOOL CTestDlg::PreTranslateMessage(MSG* pMsg) { if (pMsg->message == WM_LBUTTONDOWN) { if (pMsg->hwnd == GetDlgItem(IDC_BUTTON1)->m_hWnd) { // 按钮按下 } } else if (pMsg->message == WM_LBUTTONUP) { if (pMsg->hwnd == GetDlgItem(IDC_BUTTON1)->m_hWnd) { // 按钮弹起 } } return CDialog::PreTranslateMessage(pMsg); }
转载请注明原文地址: https://ju.6miu.com/read-900066.html
专利
最新回复
(
0
)