How to embed a custom win32 window to the WinUI3 application #9912
Replies: 4 comments
-
Do you mean that in the WinUI3_DesktopDuplication test, you cannot type keys in the Win32 control on Windows 11 ? |
Beta Was this translation helpful? Give feedback.
-
The
This window doesn't convey any input messages. It's probably there for associating the WebView2 with the window where it's been used. But the actual input is sent to the WebView2 via methods on the CoreWebView2CompositionController like SendMouseInput and SendPointerInput. Further, that So all-in-all the WebView2 cannot serve as an example for embedding win32 windows in a WinUI3 app. |
Beta Was this translation helpful? Give feedback.
-
I had some success in enabling input for an embedded hWnd inside a WinUI3 window by using an undocumented function in
|
Beta Was this translation helpful? Give feedback.
-
Please see my post here for an explanation why it doesn't work and my proposal to remedy: #10050 |
Beta Was this translation helpful? Give feedback.
-
Hi! I've added an extra win32 window to my WinUi3 application. It works as expected on Windows 10, but I had a problem with Windows 11. My window is visible but doesn't react on the mouse or receive any messages. All keyboard input goes to the window whose class is
Microsoft.UI.Content.DesktopChildSiteBridge
and I found that mouse input goes to the window whose class isMITMessageOnlyWindowClass
. The last one is not in the WinUi3 application window hierarchy and even Microsoft Spy++ doesn't show it in the desktop window hierarchy.I saw that WebView2 embeds its extra window as a child of the
Microsoft.UI.Content.DesktopChildSiteBridge
window however I didn't find any information on how to do it.I found this topic - How to embed a child window into the window in WinUI3. It discusses a similar situation, but if I understood right the code in the project of the guy who answered the topic author I should redirect application windows messages to my extra window with Win API functions. It was in 2023. I'm wondering if there is a more elegant solution at this point.
Beta Was this translation helpful? Give feedback.
All reactions