-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Using your sample code I was able to host an OpenGL page inside a WinUI3 window. However I ran into an issue which I'm not sure if it is a Windows bug or a missing step. I'm creating the child window the same way as shown in your code.
IntPtr hchild = CreateWindowEx(WS_EX_LAYERED , "Static", "",
WS_VISIBLE | WS_CHILD, x, y, width, height, hwndParent, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
SetLayeredWindowAttributes(hchild, 0, (byte)(255 * nOpacity / 100), LWA_ALPHA);
ShowWindow(hchild, SW_SHOWNORMAL);
If created in the parent window constructor, the child window displays precisely overlayed as expected. However, if the child window creation is delayed and created later by a by a member function of the parent class, it doesn't show until the parent window is moved or resized!, either by user interaction or programatically.

Create button already pressed, The counter on top shows OpenGL renders on the child window.

After moving the parent window by hand.
The same can be accomplished by calling MoveWindow() on the parent just one pixel in any direction. I've tried several Wind32 calls on the child to bring it to the front without success. Adding the flag WS_EX_TOPMOST to the child window makes no difference.