处理DLL中的窗口消息 [英] Handle window messages in DLL

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

问题描述

我想处理通过调用program

I want to handle window messages in DLL send by calling program

推荐答案

发送的DLL中的窗口消息,如Pallini所述,您可以在DLL中编写一个导出函数,该函数接受来自他的消息调用应用程序.在主应用中,您可以在应用处理它们之前拦截PreTranslateMessage来捕获它们.

或者,如果只希望DLL中的窗口来处理消息,则需要WndProc函数.或使用MFC类来处理肮脏的细节.

还是您正在寻找安装消息挂钩?

http://msdn.microsoft.com/zh-CN /library/windows/desktop/ms632589(v=vs.85).aspx [
As Pallini mentioned, you can write an exported function in your DLL that accepts messages fromt he calling app. In your main app you can intercept PreTranslateMessage to capture them before the App processes them.

Or if you just want a window in the DLL to process messages, then you need a WndProc function. Or use the MFC classes to handle the dirty details.

Or perhaps you''re looking to install a message hook?

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


您的DLL不能只提供功能吗?
然后,您的应用程序可以将Windows消息转发"到DLL,以调用带有消息详细信息的函数.
:)
Cannot your DLL just provide a function?
Your application then may ''forward'' the Windows messages to the DLL calling such a function with message details.
:)


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

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