I was using Application.AddMessageFilter()
in my WinForms
applications (when working with unmanaged code).
Now I'm switching to WPF
and can't find this functionality.
Please advice where it can be found or implemented.
A Windows Forms control that can be used to host a Windows Presentation Foundation (WPF) element.
WPF can be used to develop and design both Windows applications and web applications while WinForms can only be used to develop and design Windows applications. XAML (Extensible Application Markup Language) is used by WPF to define the user interface of a WPF application.
In WPF, you can use ComponentDispatcher.ThreadFilterMessage
event.
ComponentDispatcher.ThreadFilterMessage += ComponentDispatcher_ThreadFilterMessage;
private void ComponentDispatcher_ThreadFilterMessage(ref MSG msg, ref bool handled)
{
if (msg.message == 513)//MOUSE_LEFTBUTTON_DOWN
{
//todo
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With