请问如何获取鼠标移动到frame窗口的菜单栏或标题栏的消息,谢谢!

lsm0001 2004-05-08 12:53:19
请问如何获取鼠标移动到frame窗口的菜单栏或标题栏的消息,谢谢!
...全文
97 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
windyloft 2004-05-08
  • 打赏
  • 举报
回复
ON_WM_NCMOUSEMOVE()
zhucde 2004-05-08
  • 打赏
  • 举报
回复
或者你可以这样:
BOOL CMydilog::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message ==WM_NCMOUSEMOVE)//截取消息
if(pMsg->wParam==HTCAPTION)//当鼠标在标题栏时响应,其它的用上楼的几个UNIT
MessageBox("Ok");


return CDialog::PreTranslateMessage(pMsg);
}
zhucde 2004-05-08
  • 打赏
  • 举报
回复
很经典!
subtop 2004-05-08
  • 打赏
  • 举报
回复
附:(下面的UINT值表示你的鼠标移到了非客户区的什么地方)

HTBORDER In the border of a window that does not have a sizing border.


HTBOTTOM In the lower horizontal border of the window.


HTBOTTOMLEFT In the lower-left corner of the window border.


HTBOTTOMRIGHT In the lower-right corner of the window border.


HTCAPTION In a title-bar area.


HTCLIENT In a client area.


HTERROR On the screen background or on a dividing line between windows (same as HTNOWHERE except that the DefWndProc Windows function produces a system beep to indicate an error).


HTGROWBOX In a size box.


HTHSCROLL In the horizontal scroll bar.


HTLEFT In the left border of the window.


HTMAXBUTTON In a Maximize button.


HTMENU In a menu area.


HTMINBUTTON In a Minimize button.


HTNOWHERE On the screen background or on a dividing line between windows.


HTREDUCE In a Minimize button.


HTRIGHT In the right border of the window.


HTSIZE In a size box (same as HTGROWBOX).


HTSYSMENU In a Control menu or in a Close button in a child window.


HTTOP In the upper horizontal border of the window.


HTTOPLEFT In the upper-left corner of the window border.


HTTOPRIGHT In the upper-right corner of the window border.


HTTRANSPARENT In a window currently covered by another window.


HTVSCROLL In the vertical scroll bar.


HTZOOM In a Maximize button.
subtop 2004-05-08
  • 打赏
  • 举报
回复
如果你对消息映射熟悉的话,这么多你就明白了。
subtop 2004-05-08
  • 打赏
  • 举报
回复
1、afx_msg void OnNcMouseMove( UINT nHitTest, CPoint point );

2、添加函数定义,实现你的功能

3、ON_WM_NCMOUSEMOVE()

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧