跟踪点击事件 [英] Track click event

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

问题描述


Hi,


在我的MDI应用程序中,我在 CDockablePane中有一个按钮。单击按钮时,我显示弹出的无模式对话框。当我在新创建的弹出对话框外单击时,我正在销毁该对话框。

In my MDI application I have a button in a CDockablePane. When clicking the button I am displaying a popup modeless dialog . When clicking outside of the newly created popup dialog I am destroying that dialog.


在新创建的对话框中,我覆盖OnActivate()并在获取  nstate as WA_INACTIVE,我正在销毁对话框。

In the newly created dialog, I overrode the OnActivate() and when getting  nstate as WA_INACTIVE, I am destroying the dialog.


现在我的要求是 

Now My requirement is 


1.当我第二次单击按钮时,如果通过单击除此按钮以外的对话框外部弹出对话框,我必须再次显示弹出对话框。

1. When I click the button second time if the popup dialog is destroyed by clicking outside of the dialog other than this button, I have to display the popup dialog again.


2.如果弹出对话框被单击此按钮时第二次单击该按钮,则不应显示该对话框。

2.When I click the button second time if the popup dialog is destroyed by clicking on this button , I should not display the dialog.



CDockablePane 。每当我去OnButtonClick时,新的弹出对话框仅处于销毁状态。

OnActivate event of the new popup dialog is getting called before the OnButtonClick of the CDockablePane. Whenever I go to OnButtonClick the new popup dialog is in destroyed state only.


在onActivate中,当nstate为  WA_INACTIVE时,pWndOther总是给出cmainframe窗口。

In onActivate the pWndOther is always giving cmainframe window when nstate is WA_INACTIVE.


如何获得用户点击按钮或任何其他控件或对话框或大型机或视图?

How to get whether user clicked on the button or any other control or dialog or mainframe or view?


Wheras如果父母是CDialog而不是CDockablepane  第二次点击按钮时 新弹出对话框的OnActivate
事件被调用并且 
OnButtonClick 
未被调用。

Wheras if the parent is CDialog instead of  CDockablepane when clicking the button second time OnActivate event of the new popup dialog is getting called and OnButtonClick  is not getting called.


请帮助我满足我的要求。

推荐答案

您多次提出同样的问题。这应该不会那么困难。

使用SetCapture,如下面的示例代码所示。

You've asked this same question many times. This shouldn't be that difficult.
Use SetCapture as shown in the example code below.

https://www.codeproject.com/Articles / 31719 / Generic-Picker-Dropdown-Control

-Seetharam

-Seetharam


这篇关于跟踪点击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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