Airspace, HwndHost, etc.

Docking/MDI for WPF Forum

Posted 13 years ago by Tom P.
Version: 11.2.0551
Avatar
We are using the WPF HwndHost control to host a Win32 Control (from an external C++ DLL). This HwndHost is embedded in a DocumentWindow, inside a Workspace, in a DockSite, the ususal. Works great until we undock the DocumentWindow, and the HwndHost no longer shows the navite HWND as expected.

I'm fairly certain this is because of the well known .NET "airspace" issue.

MSDN Technology Regions Overview

In general, you can't ever put any WPF content on top of an HwndHost, unless it's in a WPF Popup. It's great that your DockingWindow based controls can actually sit on top of an HwndHost, so you are doing that part right. However, when the HwndHost is inside a DockingWindow, it can get confused.

Basically, WPF applications have a single HWND, and upon creation, the HwndHost uses that as the Parent HWND for the Win32 Control. When the DocumentWindow starts to float, I'm assuming it's put into a WPF Popup of some sort. WPF Popup controls have their own HWND, and the disconnect is causing the problem.

Once we re-dock the DocumentWindow, the Win32 Control behaves as expected.

Sooooooooo, the short question is, any suggestions?

The long question is, hey, by the way, there are other problems with the airspace issue, like AutoHide ToolWindows don't overlap and HwndHost property when expanded, but floating DockingWindows overlap just fine.

.NET 4.5 is supposed to address this on some level, but it's still unproven since it's not released.

Comments (2)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Tom,

It sounds like you might not have seen this topic in the product documentation:
"Docking & MDI Interoperability / WinForms Compatibility"

Although that topic is targeted for WinForms, really the same info applies to any sort of interop content. We have a flag you can set that probably fixes the issues you see. Try that and see if it helps.


Actipro Software Support

Posted 13 years ago by Tom P.
Avatar
Best. Tech Support. Ever.

My only suggestion would be to add a reference to the HwndHost issue to that section in the product documentation so users like me who aren't using WinFormsHost can find it easier.

7 minute turn around, all issues resolved. Give yourselves a raise, heck, give all of us a raise.

Keep up the excellent work!
The latest build of this product (v24.1.3) was released 24 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.