我想实现如下功能:
1.当鼠标移动到菜单栏某项时,弹出对应的一个Dialog
2.当鼠标移出菜单栏该项且移出弹出的Dialog时,关闭Dialog。
问题:怎么判断鼠标在菜单栏哪一项?
请问下应当怎么实现呢?
1.当鼠标移动到菜单栏某项时,弹出对应的一个Dialog
2.当鼠标移出菜单栏该项且移出弹出的Dialog时,关闭Dialog。
问题:怎么判断鼠标在菜单栏哪一项?
请问下应当怎么实现呢?
解决方案 »
- Win7下CreateFile创建文件失败错误代码5
- WTL自绘菜单时无法响应自绘事件,谁给看下问题出在哪
- 问什么我在注册表中写的键值会自动删除?
- 一个已建好的类想改变它的基类,怎么改?
- 如何让DBGrid控件同步显示数据库?在线等待高手。。。
- 鼠标控制问题。(高手请进)
- 谁有w32dsm的帮助,最好是中文的
- winnt和win2000下面文件与程序的关联不通过注册表设置的吗?为什么我改了相应的open->command没有效果,而在98下就可以??
- **********结构的实体名 到底是值还是地址?(比较弱,见笑)
- OpenGL和DirectX是什么关系?
- 这个是什么错误啊?在MFC编程中出现的
- VC中用CCoolBar在MDI下做浮动窗口问题!
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. 或者你可以这样:
BOOL CMydilog::PreTranslateMessage(MSG* pMsg)
{
if (pMsg-> message ==WM_NCMOUSEMOVE)//截取消息
if(pMsg-> wParam==HTCAPTION)//当鼠标在标题栏时响应,其它的用上面的几个UNIT
MessageBox( "Ok ");
return CDialog::PreTranslateMessage(pMsg);
}