views:

177

answers:

1

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 control is hosted within the browser. Also by giving the FullTrust access to control the PreFilterMessage is not getting called

A: 

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.

JBRWilkinson