Win32 中的多个 WndProc 函数
这可能是一个愚蠢的问题,但是您可以在 Win32 中注册多个 WndProc 函数吗?例如,一个框架捕获了一些消息,而我的应用程序对其他消息感兴趣 - 如何在不修改框架代码的情况下捕获它们?
This might be a dumb question, but can you register multiple WndProc functions in Win32? e.g. a framework catches some messages and my app is interested in other ones - how do I catch them without modifying the framework code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我正确理解您的意图,您可以通过 设置挂钩。假设您知道要挂钩其消息循环的线程,您可以按照以下方式执行某些操作(未选中):
If I understand your intention correctly, you can do that by setting a hook. Assuming you know the thread whose message loop you'd like to hook, you can do something along these lines (unchecked):
您可以使用函数
CallWindowProc
而不是DefWindowProc
链接多个消息处理函数。这是一个例子:
You can chain multiple message handling functions by using the function
CallWindowProc
instead ofDefWindowProc
.Here is an example: