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

lsm0001 2004-05-08 12:53:19
请问如何获取鼠标移动到frame窗口的菜单栏或标题栏的消息,谢谢!
...全文
69 6 点赞 打赏 收藏 举报
写回复
6 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
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()
  • 打赏
  • 举报
回复
相关推荐
发帖
VC/MFC
加入

1.5w+

社区成员

VC/MFC相关问题讨论
申请成为版主
帖子事件
创建了帖子
2004-05-08 12:53
社区公告

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