microsoft / microsoft/microsoft-ui-xaml

Proposal: Open source / make publicly available for `ReunionCaptionControlsWindow`

Open
#10,294 0 comments 1 reaction 0 assignees View on GitHub
area-TitleBar feature proposal needs-triage
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

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).

This is my current usage:
![Image](https://github.com/user-attachments/assets/da87f778-4bfa-4e09-87a0-f2e1bac0bdd8)

## 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:
```cpp
ReunionCaptionControlsWindow captionButtonWindow;
captionButtonWindow.Height(56); //56 dip height
SetParent(captionButtonWindow.getHwnd(), parentHwnd);
```
or
```cpp
ReunionCaptionControlsWindow captionButtonWindow;
captionButtonWindow.Height(56); //56 dip height
captionButtonWindow.AttachToHwnd(parentHwnd);
```
## Open Questions

Contributor guide

Open the contributing guide

Research direction

Start by locating the internal ReunionCaptionControlsWindow used with AppWindowTitleBar.ExtendsContentIntoTitleBar and review how it is attached to a Win32 window. Clarify whether the intended outcome is open sourcing the class, exposing it publicly, or adding an AttachToHwnd-style API. Done requires an agreed public scope that supports the stated caption-button customization needs.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.