如何解决这种正确的点击情况? [英] How do I resolve this RIGHT CLICKING situation?

查看:71
本文介绍了如何解决这种正确的点击情况?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的意图是当用户右键单击选项卡控件时显示浮动菜单(它具有最小尺寸且没有客户区域)

我的计划是响应选项卡控件的NM_RCLICK通知但是关联的hdr结构确实有关于点击鼠标点的任何信息。我​​需要点击鼠标的点。这就是我打算显示浮动菜单的地方。我该如何解决这个问题。

或者,当右键单击选项卡控件时,选项卡控件的父窗口是否会收到WM_RBUTTONDOWN?

或者它是否会尝试响应选项卡控件的WM_NCRBUTTONDOWN?

My intention is to dispay a floating menu when user right click on the tab control(it has minimum size and no client area)
My plan was to respond to NM_RCLICK notification for the tab control but the associated hdr structure does have any information about the point at which the mouse was clicked.I need the point at which the mouse was clicked.That's where I intend to display my floating menu.How do I solve this problem.
Or does the parent window of a tab control receive a WM_RBUTTONDOWN when the tab control is right clicked?
Or does it make sence to attempt to respond to WM_NCRBUTTONDOWN for the tab control?

推荐答案

我认为你可以通过调用 GetCursorPos [ ^ ]获取鼠标的scrren坐标。然后使用 ScreenToClient [ ^ ]获取相对于Window的位置。
I think you can do it by calling GetCursorPos[^] to get the scrren coordinates of the mouse. You then use ScreenToClient[^] to get that position relative to the Window.


事件处理程序内部:通过Mouse的GetPosition方法请求鼠标坐标。 />


Inside the event handler: request the mouse's coordinates via the Mouse's GetPosition method.


这篇关于如何解决这种正确的点击情况?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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