Passing Input events from HwndHost to underlying WPF controls?
Asked Answered
M

1

8

is there a way to pass input events (primarily mouse, but eventually keyboard input too) that occurs on a HwndHost back to the underlying WPF controls (e.g. a panel) ? i can hook up to WndProc within the HwndHost and recveive the windows messages. can i manually create a routedevent for a mouse click and send it to the parent so it bubbles up? and ideas would be appreciated. thanks jkersch

Madson answered 25/8, 2010 at 8:10 Comment(0)
M
1

If you still require an answer: yes you can. Look at the Microsoft example here: http://msdn.microsoft.com/en-us/library/ms752055.aspx In that example, the HwndHost derived class 1st creates a 'sub' window and then creates a control (ListBox) in that window. A HwndSourceHook is then added that catches messages (in the example, selection change messages from the ListBox) and uses them in the WPF context.

Mollee answered 17/2, 2011 at 12:2 Comment(1)
the question is explicitely not about the WndProc, its about forwarding the events to WPF routed events so they properly tunnel/bubble through the control tree and give other controls a chance to handle themNace

© 2022 - 2024 — McMap. All rights reserved.