Proposal: Open source / make publicly available for ReunionCaptionControlsWindow
#10294
Description
Proposal:
Open source ReunionCaptionControlsWindow
that is used when ExtendsContentIntoTitleBar
is set to true
, or make this class publicly available, or add a method, something like AttachToHwnd(hwnd)
Summary
I found it quite handy for modernize a standard win32 window utilizing AppWindowTitleBar.ExtendsContentIntoTitleBar
.
My use case is putting a webview2 into a blank win32 window (created simply with CreateWindow
), then ExtendsContentIntoTitleBar
with it. (Don't ask me why I wouldn't do that with a winui3 window instead, the webview2 control in winui3 is completely unusable to me)
The caption button (that is a child window called ReunionCaptionControlsWindow
) is nicely kept in front of the webview child hwnd, the dwm accent color border is nicely kept, and the hit testing is correctly handled (Webview content is shown through the caption bar area, but moving the window and hovering on the caption buttons are correctly routed to the caption buttons, instead of the webview window).
Rationale
- With this proposal, we can more easily modernize a win32 window.
- Open sourcing it will allow developers more easily customize the caption buttons, (like I need to modify the height, other than the simple
Standard
/Tall
options)
Scope
Capability | Priority |
---|---|
Open source ReunionCaptionControlsWindow |
Must |
Allowing creating an instance of ReunionCaptionControlsWindow manually |
Nice to have |
Add customization methods to ReunionCaptionControlsWindow |
Nice to have |
Important Notes
Examples:
ReunionCaptionControlsWindow captionButtonWindow;
captionButtonWindow.Height(56); //56 dip height
SetParent(captionButtonWindow.getHwnd(), parentHwnd);
or
ReunionCaptionControlsWindow captionButtonWindow;
captionButtonWindow.Height(56); //56 dip height
captionButtonWindow.AttachToHwnd(parentHwnd);