How to capture MouseMove event in a MFC Dialog Based application for a checkbox?(如何在基于 MFC 对话框的应用程序中为复选框捕获 MouseMove 事件?)
问题描述
我的应用程序是一个基于 VC6 MFC 对话框的应用程序,具有多个属性页.
My application is a VC6 MFC dialog based application with multiple property pages.
我必须在控件上捕获 mousemove 事件,例如 Checkbox.
I have to capture a mousemove event over a control, for example Checkbox.
如何在 MFC 中的复选框上捕获 mousemove 事件?
How can I capture the mousemove events over a checkbox in MFC?
推荐答案
感谢您的回复.我找到了为我的应用获取 mousemove 事件的方法.
Thanks for your replies.. I found a way to get the mousemove event for my app.
WM_SETCURSOR windows 消息获取鼠标移动.它返回控件和对话框的 Cwnd 指针.
WM_SETCURSOR windows message gets the mouse move. It returns the Cwnd pointer for a control and the dialog.
在下面找到我的代码.
BOOL CMyDialog::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
CWnd* pWndtooltip = GetDlgItem(IDC_STATIC_TOOLTIP);
if (pWnd != this)
{
if (IDC_SN_START_ON == pWnd->GetDlgCtrlID())
pWndtooltip->ShowWindow(SW_SHOW);
}
else
pWndtooltip->ShowWindow(SW_HIDE);
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
return true;
}
这篇关于如何在基于 MFC 对话框的应用程序中为复选框捕获 MouseMove 事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在基于 MFC 对话框的应用程序中为复选框捕获 MouseMove 事件?
基础教程推荐
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- 初始化列表*参数*评估顺序 2021-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- CString 到 char* 2021-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
