Can anyone please help me? I want to use WndProc in WPF but I don´t want to use it in the MainWindow.xaml.cs like this:
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 a different class the reason is that the uEye camera communicates over messages and I need to "catch" them. And because I am using the Main View ViewModel Model I dont want to enter code to the MainWindow.xaml.cs.