ControlScrollFilter.PreFilterMessage Method

Filters out a message before it is dispatched.
public bool PreFilterMessage( 
ref Message m 
)
This language is not supported or no code example is available.

Parameters

m
Message

The message to be dispatched. You cannot modify this message.

Return Value

bool

true to filter the message and stop it from being dispatched; false to allow the message to continue to the next filter or control.

Implements

IMessageFilter.PreFilterMessage
public bool PreFilterMessage(ref Message m)
 {
     switch (m.Msg)
     {
         case (int)Enums.WINDOW_MESSAGE.MOUSE_WHEEL:
         case (int)Enums.WINDOW_MESSAGE.MOUSE_H_WHEEL:
             var hControlUnderMouse = Import.WindowFromPoint(new Point((int)m.LParam));
             if (hControlUnderMouse == m.HWnd) { return false; }
             Import.SendMessage(hControlUnderMouse,
                 (uint)m.Msg,
                 m.WParam,
                 m.LParam);
             return true;
     }
     return false;
 }
					
This language is not supported or no code example is available.

.NET Framework

Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8

.NET Core

Supported in: 5.0+, 6.0+

In this article

Definition