Passing input events from HwndHost to basic WPF controls?

Is there a way to pass input events (mainly a mouse, but ultimately keyboard input) that happens on HwndHost back to the basic WPF controls (like a panel)? I can connect to WndProc in HwndHost and receive Windows messages. can I manually create a routedevent for a mouse click and send it to the parent so that it bubbles? and ideas will be appreciated. thanks jkersch

+7
wpf hwnd routedevent
source share
1 answer

If you still need an answer: yes you can. See the Microsoft example: http://msdn.microsoft.com/en-us/library/ms752055.aspx In this example, the derived class HwndHost 1st creates a sub window and then creates a ListBox in this window. Then an HwndSourceHook is added, which catches the messages (in the example, messages about the change of choice from the ListBox) and uses them in the WPF context.

0
source share

All Articles