Thank you for your question.
Create a class (or use application's form) that implements IMessageFilter:
Code: Select all
public class MainForm : System.Windows.Forms.Form, IMessageFilter
{
...
private const int WM_LBUTTONDOWN = 0x0201;
private const int WM_LBUTTONUP = 0x0202;
private const int WM_LBUTTONDBLCLK = 0x0203;
public bool PreFilterMessage(ref Message m)
{
if (m.HWnd == f_in_box__control1.Handle)
{
if (WM_LBUTTONUP == m.Msg || WM_LBUTTONDOWN == m.Msg || WM_LBUTTONDBLCLK == m.Msg)
{
// Handle the message
...
// return true to not pass the message to f_in_box__control1.
return true;
}
}
return false;
}
...
public MainForm()
{
...
Application.AddMessageFilter(this);
}
...
}
Don't forget to remove filter.
If PreFilterMessage returns true, a message is not passed to a window.
So you should handle WM_LBUTTONDOWN and others inside your filter. And return false to not pass a message to a movie.
Thank you.