IMessageFilter for wpf

天大地大妈咪最大 提交于 2019-12-24 11:44:57

问题


I couldn't find anything about it online, so is there an interface similar to IMessageFilter for wpf, or a way of using this interface with a wpf window? Thanks.


回答1:


Short answer is no. There is no equivalent of IMessageFilter in WPF. As per Josh Smith -

There is no equivalent of IMessageFilter in WPF. But you might be able to devise some scheme where your app's main window's wndproc is subclassed and you filter on the power-awareness messages. When they pass through, notify some other class which the entire application can then listen to via Observer pattern.



来源:https://stackoverflow.com/questions/17511405/imessagefilter-for-wpf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!