Can anybody help me? I want to use WndProc in WPF, but I do not want to use it in MainWindow.xaml.cs as follows:
public MainWindow()
{
InitializeComponent();
}
protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
HwndSource source = PresentationSource.FromVisual(this) as HwndSource;
source.AddHook(WndProc);
_windowHandle = source.Handle.ToInt32();
}
I want to use it in another class, the reason is that the uEye camera is exchanging messages, and I need to "catch" them. And since I am using the ViewModel Main View model, I do not want to enter code in MainWindow.xaml.cs.
source
share