Windows Title Bar Color (Win 10)

Has anyone had any success in changing the title bar color in Windows 10?

I came across this document on MS Docs:

Title bar customization - UWP applications | Microsoft Docs

I have not done any API calls so this is somewhat foreign to me - not somewhat, who am I kidding…

There are numerous threads on the forums, but I couldn’t find any solutions.

I tried a plan box, but that has some limitations. Notably, If I set it to NO close, maximize, minimize buttons (I’ll roll my own with a canvas) but allow resize there is a weird 10 or so pixel border at the top. Very odd.

Suggestions?

Here is an example of the the weird border at the top on a “Plain Box” window when resize is set to TRUE. I was going to roll my own title bar, but this bar cannot be overwritten. Xojo 2020 R2.1

image

image

Not the exact answer, but… do you know you can set a window background color.

In your cas, you can use a decent red as the window color background.

It’s just an idea.

Yes, but I want the color of the title bar to match the window color.

Hi, Joseph.
I don’t believe there’s a simple way to get this out of the box in Xojo without using declares.

I do provide a number of methods for getting system colors in my GraffitiColors module, including the GraffitiColors.Windows module devoted to Windows specifically with methods that function for Windows 7 and up, and the GraffitiColors.Windows.Immersive module which supports the extended colors available in Windows 10. If you plan to build your own custom window and emulate system components, I’d say it’s worth looking at.

1 Like

There are declares you can use to completely remove the titlebar, and you can find those in the Windows Functionality Suite as an extension for the window class as HasTitleBarWFS. If that doesn’t work, rolling your own resize functionality using the mouse events on a window is a viable option.

1 Like

Is there documentation on how to use the Windows Functionality Suite?

Not really, and some of it is outdated so it may need some work. You might be able to just grab the module I linked and put it in your project and be done. You’d then call it as:

myWindowInstance.HasTitleBar = False

Well, I tried the WFS HasTitleBar = False and it does remove the title bar but it also displays the weird band of pixels at the top that cannot be overwritten. That portion of the screen is not accessible. Just like the native plain box in Xojo if resizable is true.

Bummer. Looks like I have to deal with the resizing of the plain box.

github.com says (for WFS):

Latest commit 819dc9e on 5 Jun 2013