拦截消息到窗口 [英] Intercepting messages to a window

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

问题描述

是否可以拦截正在发送到窗口的消息。我的PC上有一个消息窗口,它在某些事件上接收文本字符串,我想用一个单独的应用程序拦截这些消息,以防我需要采取一些措施。我可以使用FindWindow获得窗口的HWND,但我不知道我是否可以用它来做我需要的东西。



谢谢



Tony

解决方案

您尚未指定编程平台。但根据你的表述,我想你使用的是c ++。所以你可以从这里开始: InterSpy - 一个集成的Windows消息跟踪和过滤器实用程序 [ ^ ]


您可以通过安装Windows Hook来拦截消息。如果您需要截取应用程序之外的某些消息,则钩子应该是全局的。根据Microsoft文档,为了使其全局化,您只能在本机Windows DLL中安装钩子。请从这里开始: http://msdn.microsoft。 com / zh-CN / library / windows / desktop / ms632589%28v = vs.85%29.aspx [ ^ ]。



-SA

Is it possible to intercept messages which are being sent to a window. I have a ''messages'' window running on my PC which receives text strings upon certain events and I would like to intercept these messages with a separate application in case I need to take some action. I can get a HWND for the window using FindWindow, but I dont know if I can use this to do what I need.

Thanks

Tony

解决方案

You have not specified the programming platform. But according to your formulation, I suppose you use c++. So you can start here: InterSpy - An integrated Windows message trace and filter utility[^]


You can intercept messages by installing a Windows Hook. If you need to intercept some messages outside your application, the hook should be global. According to Microsoft documentation, to make it global, you can only install the hook in a native Windows DLL. Please start here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms632589%28v=vs.85%29.aspx[^].

—SA


这篇关于拦截消息到窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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