Adds a message filter to monitor Windows messages as they are routed to their destinations.
[Visual Basic] Public Shared Sub AddMessageFilter( _ ByVal value As IMessageFilter _ ) [C#] public static void AddMessageFilter( IMessageFilter value ); [C++] public: static void AddMessageFilter( IMessageFilter* value ); [JScript] public static function AddMessageFilter( value : IMessageFilter );
Use a message filter to prevent specific events from being raised or to perform special operations for an event before it is passed to an event-handling method. Message filters are unique to a specific thread.
To prevent a message from being dispatched, the value parameter instance that you pass to this method should override the PreFilterMessage method with the code to handle the message. The method should return false.
CAUTION Adding message filters to an application's message pump can cause performance degradation in your application.
NGWS Runtime Security:
UIPermission | You must have the System.security.Permissions.UIPermission for AllWindows to set this method. |
Application Class | Application Members | System.WinForms Namespace