Immersive Dark mode / Dark title bar

Advertisement

jonaskohl
Joined:
Posts:
3

Immersive Dark mode / Dark title bar

I really like using WinSCP. It has been my daily-driver FTP client for years now. And I really enjoy WinSCP's dark theme. However, the bright white titlebar really sticks out and it would be very fitting to use Windows 10's (undocumented, but still commonly used) so-called 'Immersive dark mode'. There are several APIs to do this. I don't know a lot about C++, but from what my research yielded, those are the methods to enable a dark title bar on Windows 10:

1st method:
BOOL WINAPI SetWindowCompositionAttribute (
    HWND hwnd,
    WINCOMPATTRDATA* pAttrData
);
located in user32.dll using WCA_USEDARKMODECOLORS = 26

2nd method:
DWMAPI DwmSetWindowAttribute(
  HWND    hwnd,
  DWORD   dwAttribute,
  LPCVOID pvAttribute,
  DWORD   cbAttribute
);
(dwmapi.dll / dwmapi.h) using the undocumented constants DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 = 19 (for Windows 10 versions before 2004) or DWMWA_USE_IMMERSIVE_DARK_MODE = 20 (for Windows 10 versions 2004 and later)

There are also the functions AllowDarkModeForWindow (uxtheme.dll, #133) and AllowDarkModeForApp (uxtheme.dll, #135)

I have written a small tool that lets me enable or disable dark mode for (almost) any open window, which let me take screenshots of how WinSCP would look with a dark title bar (please see attached screenshots).

I hope that this is enough information to get you started and I look forward to hopefully seeing this feature implemented in the future!

Best regards!
Jonas

Description: Screenshot of WinSCP of how it looks with a dark title bar

winscp_dark_titlebar.png

Description: Screenshot of WinSCP of how it currently looks

winscp_light_titlebar.png

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,602
Location:
Prague, Czechia

Re: Immersive Dark mode / Dark title bar

Thanks for your elaborate port.

This issue has been added to the tracker:
https://winscp.net/tracker/1920

I've opted to use DwmSetWindowAttribute with 20. So with support for 2004 and newer only.

Tomorrow, I'll send you an email with a development version of WinSCP to the address you have used to register on this forum.

Reply with quote

Pyre909
Donor
Joined:
Posts:
21
Location:
Utah

Dark Title Bar on White Theme

Hi Martin,

Not sure if its intended, but the title bar is coming out dark when the white theme is set on the latest dev build.

Dark theme looks great by the way.

Also I am on the latest version of Windows 20H2.

- Thanks!

Description: Dark Title Bar On White Theme

Capture.PNG

Reply with quote

Advertisement

willmart2
Guest

Title Bar white

Hello there, I'm still getting a white title bar on dark mode. Running windows 10 pro 20H2. Lastest. Any other settings I should change? Thanks

Reply with quote

Advertisement

You can post new topics in this forum