microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.73k stars 309 forks source link

Proposal: Expose UWP titlebar and coretitlebar API to Win32 apps #49

Closed mveril closed 2 years ago

mveril commented 4 years ago

Proposal: Expose all UWP titlebar and coretitlebar API to Win32 apps

Summary

The ApplicationViewTitleBar and CoreApplicationViewTitleBar have amazing features to personalizing the title bar (see title bar customization documentation. We can easily change the colors of the title bar or put a control in the title bar. These features are absent from Win32 (or less affluent) they are also unavailable in WinUI 3 Desktop Desktop.

Rationale

Scope

Important Notes

Felix-Dev commented 4 years ago

@mveril The WinUI team is aware of this and while functionality like Window.SetTitleBar() won't make it into WinUI 3.0 (for Desktop) I believe this on the todo-list for subsequent WinUI releases (3.x/4....).

mdtauk commented 4 years ago

If Core Application's title bar can't be opened for Win32 apps, then all the same functionality should be wrapped into a clean API that removes the need to drive into the HWND

Gavin-Williams commented 4 years ago

@mdtauk I agree with this. Why should a non-contained app not be able treat it's Titlebar just the way a UWP app can - it is a completely arbitrary limitation. It only makes sense in a world where Win32 is being left behind, but since it's not, Win32 has to be updated to look like UWP.

mdtauk commented 4 years ago

I imagine UWP has a very specific and locked down implementation of a HWND interface, but part off Win32's flexibility is being able to fully control that.

I would like to see an option on the new Window Xaml element, that allows you to pick a window style, one of those being a modern or Fluent style window

eklipse2k8 commented 4 years ago

Terminal app is using a normal HWND window to extend Xaml elements on to it. Granted it's a bit hacky how they have 2 xaml islands, but there's an example of how to do it.

You can already paint into the titlebar area of a normal Window, just do a google search and every possible language has examples in stack overflow.

AzAgarampur commented 3 years ago

@eklipse2k8 True, but ever since Windows 10 introduced the transparent non client area that allows Windows to appear borderless (compared to Windows 8 or 7), there's a lot more work than a simple call to AdjustWindowRectEx and using it's returned values in DwmExtendFrameIntoClientArea to draw onto a title bar.

Personally, I think that this is the right solution, however, there will always be developers who cut corners. I believe that adding a simply set of classes/interface to do all that for you would be nice.

Backup-eric645 commented 3 years ago

I'm gonna develop custom title-bar tools for Win32 developers :)

stevewri commented 3 years ago

@rkarman - this ask lines up nicely with some windowing proposals you're looking at.

mveril commented 2 years ago

I think the features of Windows App SDK 1.0 AppWindowTitleBar solve this issue Although there are some limitations

So I can close it Thanks