找出是否单击了其他应用程序中的表单上的按钮的任何方法 [英] Any way to find out if a button on a form in other application is clicked

查看:44
本文介绍了找出是否单击了其他应用程序中的表单上的按钮的任何方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

有没有办法找出是否单击了其他应用程序中的表单上的按钮(使用C#).谁可以帮助我?

谢谢.

解决方案

您可以使用全局CBT挂钩来实现此目的.这是我写的关于该主题的一篇旧文章:

使用消息和简单的CBT挂钩操作Windows [
重要!不要在此页面上发布新答案!没有人会收到电子邮件通知;您的信息将在以后被删除.

—SA


否,因为click事件将永远不会离开其他应用程序.您无法知道用户是否单击了其他应用程序按钮.

当然,除非其他应用程序公开了某种类型的界面,您可以订阅该界面以获取关于应用程序中发生的事情的通知,尽管很少见到.


Hello,

Is there any way to find out if a button on a form in other application is clicked (using C#). Who can help me?

Thanks.

You can use global CBT hooks to achieve this. Here''s an old article I wrote on the topic:

Manipulating Windows using messages and simple CBT hooking[^]

In my article I manipulate those windows by sending messages. In your case you''d have to hook into the window procs and handle messages (which will include button clicks and the like).


Correct Answer is given by Nishant. I only want to add that your question looks like you have an idea to abuse clean and practical software techniques. Tricks like that are not easy and will never give you any robust results.

I''m almost sure that if you share your ultimate goals, you would be able to get more constructive help; chances are, your problem will be resolved in a civilized way.

If you want it, please, use "Improve question" and "Add comment" to this Answer.

Important! Don''t post new Answer on this page! Nobody will receive e-mail notification; your post will be later removed.

—SA


No, since the click event will never leave the other application. You have no way of knowing if a user clicked on another applications buttons.

Unless, of course, the other application exposes some kind of interface that you can subscribe to to get notifications on what''s going on in the app, though it is rare to find this.


这篇关于找出是否单击了其他应用程序中的表单上的按钮的任何方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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