关于 WM_MOUSEHOVER、控件和气球
我在 GUI 应用程序上的 WindowProc 内的 switch (msg) 循环中有此代码。
case WM_MOUSEMOVE:
TRACKMOUSEEVENT tme;
tme.cbSize = sizeof(TRACKMOUSEEVENT);
tme.dwFlags = TME_HOVER;
tme.dwHoverTime = 100;
tme.hwndTrack = hwnd;
TrackMouseEvent(&tme);
break;
case WM_MOUSEHOVER:
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG), hwnd, AboutDlg);
break;
我想知道是否可以做任何事情来仅当我将鼠标悬停在窗口的控件上时才发生 WM_MOUSEOVER 事件(在本例中为 CHECKBUTTON)
我需要这个,因为我想要有关此复选框的一些解释(我不想将其写在标签上)以在鼠标悬停在其上时弹出。 我不想要对话框...是否有任何出现和消失的气球(或没有“确定”按钮的东西)而不是对话框或消息框?
多谢
I have this code in the switch (msg) loop inside WindowProc on my GUI App.
case WM_MOUSEMOVE:
TRACKMOUSEEVENT tme;
tme.cbSize = sizeof(TRACKMOUSEEVENT);
tme.dwFlags = TME_HOVER;
tme.dwHoverTime = 100;
tme.hwndTrack = hwnd;
TrackMouseEvent(&tme);
break;
case WM_MOUSEHOVER:
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG), hwnd, AboutDlg);
break;
I was wondering if I could do anything to have event WM_MOUSEOVER only when I hover over a Control of the window (in this case a CHECKBUTTON)
I need this because I want some explanation about this checkbox (I don't want to write it on the label) to popup when the mouse is over it. I don't want either a DialogBox... is there any Balloon (or something without an OK button) that appears and dissappears instead a dialogbox or messagebox?
Thanks a lot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它称为工具提示。 它们通常根本不需要您跟踪任何鼠标事件。 您甚至可以让它们看起来像对话气球。 要开始使用,请在 MSDN 中阅读有关它们的信息。
It's called a tooltip. They often don't require you to track any mouse events at all. You can even make them look like speech balloons. To get started, read about them in MSDN.