Tracking WPF mouse movements amidst multiple WindowsFormsHost controls?

I don't think there is a good solution besides using a global mouse hook as outlined here along with a function like Visual. PointFromScreen to translate the global screen coordinate to an application local coordinate.

Up vote 0 down vote favorite 1 share g+ share fb share tw.

I have a WPF application that has several WindowsFormsHost controls. I'm trying to track the mouse position inside of my application when it is maximized in full-screen mode. If the user puts the mouse near the top screen, I'd like to display a Window with additional menus.

I can use: Window. PreviewMouseMove InputManager. PreProcessInput, or even HwndSource.

FromHwnd(WindowInteropHelper(mainWindow). Handle). AddHook(...) to receive move events so long as the mouse doesn't move over a WindowsFormsHost (if the user does this, I do not receive an event).

I think the root problem is because WPF uses a separate HWND for each WindowsFormsHost. Is there a good way to track the mouse movements across my application without having to manually find each WindowsFormsHost and subscribe to its mouse move events? I'd also like to avoid a global Windows mouse listener if possible.

Wpf mouse winforms-interop link|improve this question edited Oct 12 '10 at 16:53 asked Oct 12 '10 at 16:48Jeff Moser7,1601540 100% accept rate.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions