MFC OnLButtonUp问题 [英] MFC OnLButtonUp issue

查看:250
本文介绍了MFC OnLButtonUp问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我创建了一个SDI应用程序并覆盖了消息映射

Hi all,
I have created a SDI application and overwritten the message map

ON_WM_LBUTTONUP(),ON_WM_LBUTTONDOWN()

.我正在获取控件

.I am getting the control in

afx_msg void OnLButtonUp(UINT nFlags, CPoint point){....}
afx_msg void OnLButtonDown(UINT nFlags, CPoint point){....}


同时在我的应用程序内单击左按钮并释放点击.


但这是我的问题,
如果在我的应用程序外部单击 [在桌面上说],然后在我的应用程序内部释放单击 n,则不会调用OnLButtonUp().为什么?如果无法实现,请提供其他解决方案.


在此先感谢.


while clicking the left button inside my application and releasing the click.


but here is my problem,
If click the left button outside of my application[say in desktop] and releasing the click inside my application then OnLButtonUp() is not getting called.Any Idea why? and if its not possible them please give some alternate solution.


Thanks in advance.

推荐答案

此行为是设计使然;)
它与允许用户将内容从一个应用程序拖放到另一个应用程序有关.

还有其他鼠标消息可能会帮助您解决问题.您可以从这里开始:

WM_MOUSEMOVE [
This behavior is by design ;)
It has something to do with allowing the user to drag things from one application and drop them on another.

There are other mouse messages that may do the trick for you. You may start here:

WM_MOUSEMOVE[^]; you can check the flag MK_LBUTTON and see when it is turned off.

Hope this helps,

Pablo.


不知道它是否适合您的需求,但是您可以尝试安装全局钩子并捕获鼠标事件并对其进行反应,例如以某种方式将所需消息中继到您自己的过程.
请参阅
[ WindowFromPoint [
Don''t know if it suits your needs or not, but you could try installing a global hook and catch mouse events and react on them, like relay the needed messages someway to your own process.
See this[^] for starters.
The WindowFromPoint[^] function might come in handy too...


这篇关于MFC OnLButtonUp问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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