Drawing over an Embedded Process/Window #3879
-
Hi ! I'm using the Is there a way to specify a Z-index for them that takes precedence over the Z-indices of the embedded window ? Example (going from topmost to bottommost) :
Thanks ! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
To put it bluntly, no. Finally, WinUI 3 questions really should be in the WinUI repository. |
Beta Was this translation helpful? Give feedback.
-
There is Microsoft.UI.Content.ContentExternalOutputLink with IDCompositionDesktopDevice.CreateSurfaceFromHwnd, ElementCompositionPreview.SetElementChildVisual that I had tested in C# some months ago inside a XAML Image control, so drawn behind XAML controls like Popups, but for static windows (no user interaction) |
Beta Was this translation helpful? Give feedback.
-
They don't seem in docs (still marked "Experimental", I had done tests from tools like ILSpy to list all interfaces...) |
Beta Was this translation helpful? Give feedback.
To put it bluntly, no.
There are a couple of things at play here which works against you. First, grabbing a window and shoving it into another tends to require cooperation from both windows for everything to work correctly. There is no Xaml control or method that officially supports hosting a HWND inside a WinUI 3 application. This means that WinUI 3 is unaware of the embedded window.
Second, WinUI 3 uses an implementation of the Visual Layer to do the drawing. For desktop applications, this is built upon DirectComposition. This means that this model is in use. There are two layers. The lowest layer, child windows are drawn on top of that, then finally there is an upper layer. Each layer …