是否存在应用程序激活/停用和应用程序创建/销毁的全局事件? [英] Is there any Global events for application activation/deactivation and aplication Created/Destroyed?

查看:105
本文介绍了是否存在应用程序激活/停用和应用程序创建/销毁的全局事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当计算机中的任何应用程序被创建/销毁并激活/停用时,有任何方法可以触发事件。





全局关键点全局鼠标一样。

解决方案

关于流程启动和终止事件,请看这个CodeProject文章:挂钩本机API并控制系统上的进程创建全基础 [ ^ ]。



关于激活和停用,目前尚不清楚你是什么意思。可以激活和停用窗口;这可能是全局窗口钩子的主题。如果这是您正在查找的内容,或者您​​可以使用钩子类型 WH_GETMESSAGE 并在窗口获取消息时跟踪事件 WM_ACTIVATE

http: //msdn.microsoft.com/en-us/library/windows/desktop/ms646274%28v=vs.85%29.aspx [ ^ ],

http://msdn.microsoft.com/en-us /library/windows/desktop/ms644959(v=vs.85).aspx#whgetmessagehook [ ^ ]。



-SA

Hey there is any way to to triggered event when any application in computer is created/destroyed and activate/deactivate.


Like Global keyhook and global mousehook.

解决方案

As to the process starting and termination events, please see this CodeProject article: Hooking the native API and controlling process creation on a system-wide basis[^].

As to activation and deactivation, it's not clear what do you mean. A window can be activated and deactivated; and this could be a subject of global window hook. If this is what you are looking or You can use the hook type WH_GETMESSAGE and track the event when a window gets message WM_ACTIVATE:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646274%28v=vs.85%29.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/ms644959(v=vs.85).aspx#whgetmessagehook[^].

—SA


这篇关于是否存在应用程序激活/停用和应用程序创建/销毁的全局事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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