Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mveril opened this issue May 23, 2020 · 9 comments
Closed

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

mveril opened this issue May 23, 2020 · 9 comments

Comments

@mveril
Copy link

mveril commented May 23, 2020

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

  • Allow Win32 apps developers to customise title bar easily.
  • Allow consistent title bars and navigation UI between UWP and Win32 especialy for WinUI 3.

Scope

Important Notes

  • usage examples
    Extend NavigationView TabView or Pivot into title bar like it's already possible in UWP in WinUI 3 desktop according title bar to the Application color scheme…
  • other implementation notes
    I think these API depend on CoreWindow and Win32 windows have Hwind windows that is different and it's may be complicated to merge the capabilites of CoreWindow title bar to Hwind title bar.
@mveril mveril added the feature label May 23, 2020
@mveril mveril changed the title Proposal: Expose all UWP titlebar and coretitlebar API to Win32 apps Proposal: Expose UWP titlebar and coretitlebar API to Win32 apps May 23, 2020
@Felix-Dev
Copy link

Felix-Dev commented May 23, 2020

@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
Copy link

mdtauk commented May 23, 2020

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
Copy link

@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
Copy link

mdtauk commented May 25, 2020

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
Copy link

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.

@stevewri stevewri self-assigned this Jul 13, 2020
@AzAgarampur
Copy link

@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
Copy link

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

@stevewri
Copy link
Contributor

stevewri commented Dec 3, 2020

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

@mveril
Copy link
Author

mveril commented Oct 16, 2021

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

  • The Windows App SDK does not currently provide methods for attaching UI framework content to an AppWindow.

  • In the current release, title bars can be customized only on Windows 11.

So I can close it
Thanks

@mveril mveril closed this as completed Oct 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants