PreFilterMessage is not called when hosting C# control within Internet Explorer
Here is a sample: 1. Create a class 'public class RichTextBoxEx : RichTextBox, IMessageFilter'. 2. Implement 'public bool PreFilterMessage(ref Message m)'. 3. Enter into edit mode of the control and type any text.
The result is as describe above... the 'PreFilterMessage' is not called when the cont开发者_如何学运维rol is hosted within the browser. Also by giving the FullTrust access to control the PreFilterMessage is not getting called
Not all messages are passed through the PreMessageFilter mechanism. Only the messages that are posted to your control are filtered - direct messages are not filtered.
Override the WndProc() function to filter all kinds of messages.
精彩评论