4

Since the 2018 October updates windows 10 developers are blessed with a dark explorer Theme. This seems like it is not a borderless window with some colored elements slapped on top, but that this is actually a dark DWM powered title bar. So, does anyone know of a API that allows your own applications to apply this to you own windows?

These are a real eye sore when developing dark themed applications:

enter image description here

Just to be clear. I don't want to reimplement the buttons myself. There is no implementation that perfectly mimics the native behavior of a title bar. Not even applications like Word, that are from Microsoft themselves, get the implementation correct. As an example, when a native window hides it's Minimize etc. buttons when you hover over the preview in the task bar.

DVSProductions
  • 77
  • 1
  • 13
  • Possible duplicate of [Changing WPF title bar background color](https://stackoverflow.com/questions/1283006/changing-wpf-title-bar-background-color). Also you can use tools like _MahApps Metro_ –  Oct 30 '19 at 23:45
  • It's all undocumented so far. – Jonathan Potter Oct 30 '19 at 23:50
  • I have the answer.... too bad it's been closed as dupe. I suspect the duped questions don't answer what the OP is looking for. – selbie Oct 31 '19 at 00:15
  • 1
    @JonathanPotter - there's sample code on Microsoft's GitHub account for this. See this link: https://github.com/microsoft/terminal/blob/master/src/interactivity/win32/windowtheme.cpp – selbie Oct 31 '19 at 00:21
  • 1
    It's DwmSetWindowAttribute with a value of "19" and a BOOL value parameter. – selbie Oct 31 '19 at 00:21
  • 1
    @selbie I would post your answer on that other question if you think it adds to the information already available there. This question is not significantly different. – Jonathan Potter Oct 31 '19 at 00:25
  • Important update. Since Windows 10 May 2020 you need to pass a magic constant "20" instead of "19" to DwmSetWindowAttribute() as 2nd parameter to set a Dark mode for window title in your app. – Igor Jun 01 '20 at 10:37

0 Answers0