From Newsgroup: comp.lang.tcl
On 3/15/2026 8:34 AM, meshparts wrote:
Am 15.03.2026 um 13:26 schrieb Harald Oehlmann:
Here is written how to enable it:
https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/ui/ apply-windows-themes
File a ticket in Tk and perhaps somewone will work on the fix.
AFAI you refuse to touch the C code, so you depend on the grace of others Efye.
Take care,
Harald
Thanks Harald, but I guess this solution is way to complicated for me and my knowledge level.
I might post a ticket then.
Regards
Alex
How badly do you want this? :)
I got an AI to create a truly ugly script that can do this on my windows 10 system. It uses powershell and wscript. The wscript isn't actually needed, and cmd.exe can be used, but then you end up with a brief flash of the cmd window.
Also, when the window has focus, it will still show the titlebar with the normal window color, blue in my system. It will be dark only when another window has focus.
proc apply_dark_titlebar {win} {
update idletasks
set hwnd [expr {[wm frame $win]}]
set ps_file "$::env(TEMP)/dark_titlebar.ps1"
set vbs_file "$::env(TEMP)/dark_titlebar.vbs"
set ps_script "\$v = 1
\$hwnd = \[IntPtr\]${hwnd}L
Add-Type @'
using System;
using System.Runtime.InteropServices;
public class DWM {
\[DllImport(\"dwmapi.dll\")\]
public static extern int DwmSetWindowAttribute(IntPtr h, int a, ref int v, int s);
}
'@
\[DWM\]::DwmSetWindowAttribute(\$hwnd, 19, \[ref\]\$v, 4)
"
set fh [open $ps_file w]
puts $fh $ps_script
close $fh
set ps_native [file nativename $ps_file]
set vbs_script "CreateObject(\"WScript.Shell\").Run \"powershell.exe -ExecutionPolicy Bypass -NonInteractive -WindowStyle Hidden -File \"\"$ps_native\"\"\", 0, True"
set fh [open $vbs_file w]
puts $fh $vbs_script
close $fh
catch { exec wscript.exe $vbs_file }
# Force DWM to recompose by withdrawing and re-showing
wm withdraw $win
wm deiconify $win
raise $win
focus $win
file delete $ps_file
file delete $vbs_file
}
if [catch {
package require awdark
::ttk::style theme use awdark
} err_code] {
puts $err_code
}
wm geom . 405x200+32+32
ttk::frame .f
ttk::button .f.b -text "Apply Dark Title" -command { apply_dark_titlebar . ;after 200 {console show}}
pack .f .f.b -fill x -expand true
--- Synchronet 3.21d-Linux NewsLink 1.2