I tried to derive a class form ElementHost and overiding the CreateParams method:
protected override CreateParams CreateParams { get { const int WS_EX_TRANSPARENT = 0x20; CreateParams cp = base.CreateParams; cp.ExStyle = cp.ExStyle | WS_EX_TRANSPARENT; return cp; } }
This makes it transparent, but the form is not clickable.
Try adding this to your derived class:
This should make the entire ElementHost ‘transparent’ to the mouse, if you want the WPF content to respond to the mouse you will have to use VisualTreeHelper.HitTest to decide what to return from your WM_NCHITTEST handler.
I haven’t tested it with ElementHost but it works with normal WinForms controls.