Name

IMessageFilter

Synopsis

This interface is implemented by classes that want to filter messages before they are dispatched to your application. You should implement the PreFilterMessage() method, to intercept messages, carry out any additional processing you require, and then either pass them on to the rest of the system (by returning false) or cancel the dispatch by returning true.

To install a message filter, you can use the Application.AddMessageFilter() method. Note that the installation of message filters can impede the performance of your application, as it requires a small block of extra code and a method call for every message dispatched.


public interface IMessageFilter {

// Public Instance Methods

   public bool PreFilterMessage(ref Message m);

}

Implemented By

Splitter

Passed To

Application.{AddMessageFilter(), RemoveMessageFilter()}

Get .NET Windows Forms in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.