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 事件?
基础教程推荐
- 这个宏可以转换成函数吗? 2022-01-01
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 常量变量在标题中不起作用 2021-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 我有静态或动态 boost 库吗? 2021-01-01
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
