如何在基于MFC对话框的应用程序中捕获复选框的MouseMove事件? [英] How to capture MouseMove event in a MFC Dialog Based application for a checkbox?

查看:98
本文介绍了如何在基于MFC对话框的应用程序中捕获复选框的MouseMove事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序是具有多个属性页的基于VC6 MFC对话框的应用程序.

My application is a VC6 MFC dialog based application with multiple property pages.

我必须捕获某个控件(例如Checkbox)上的mousemove事件.

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.

在下面找到我的代码.

Find my code below.

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事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆