MicrosoftEdge / MicrosoftEdge/WebView2Feedback

WebView2 control is not visible after changing the parent window

Open
#985 14 comments 0 reactions 2 assignees View on GitHub

@Lakshmisha-KS is already working on this.

Since Mar 3, 2025.

feature request tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Description
We are migrating our PowerPoint integration from CefSharp (a different Chromium-based webview control) to WebView2 and we have bumped into an issue when trying to change the parent window of a window with WebView2 control inside.

The way how our integration works is that we create a new WinForms window containing a WebView2 control and then during a slideshow, we occasionally cover the slideshow window with our WebView2 window (to "replace" the content of the presented slide). But, before we display that window, we need to change the parent window of our WebView2 window to the PowerPoint slideshow window (by calling the function SetParent with HWND of the PowerPoint Slideshow window) - so apps like Zoom or MS Teams stream also our WebView2 content while streaming just the PowerPoint slideshow window.

Unfortunately, it looks that the WebView2 WinForms control (unlike the CefSharp WinForms control) is not compatible with that solution: after changing the parent window, we can see just the empty WinForms window - the WebView2 control is not visible (although the embedded web is loaded).

Version
SDK: 1.0.790-prerelease
Runtime: 88.0.705.74 (Evergreen Bootstrapper)
Framework: WinForms
OS: Win10

Repro Steps

  1. Create a WinForms window with a WebVew2 control inside
  2. Change the parent window of that window using the SetParent function from Winuser.h to another (already visible) window
  3. Show the WinForms/WebView2 window
  4. Observe, that the parent window is covered by the empty WinForms/WebView2 window (the WebView2 control is not visible)

Additional context
The entire integration is built as a COM add-in (so it is running from the PowerPoint process).

AB#26124929

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.