Disassembler0 / Win10-Initial-Setup-Script

PowerShell script for automation of routine tasks done after fresh installations of Windows 10 / Server 2016 / Server 2019
MIT License
4.7k stars 1.08k forks source link

Enable Title Bar Color #162

Closed scruel closed 5 years ago

scruel commented 5 years ago

the color of title bars are all white by default and can not customize it, this tweaks can make all title bar as current windows color.

scruel commented 5 years ago

For more, we can set a specified color for all inactive title bar, which will not create a PR causes it is a personalized setting.

Function SetTitleBarInactiveColor {
    Write-Output "Setting TitleBar inactive color..."
    # The active window color(priority)
    New-Item-IfNotExist "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Accent" | Out-Null
    Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Accent" -Name "AccentColorMenu" -Type DWord -Value 0xffb46b3a

    # The theme color of current active window
    Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "AccentColor" -Type DWord -Value 0xffb46b3a

    # The theme color of current inactive window
    Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "AccentColorInactive" -Type DWord -Value 0xffb47841
}

# Unset Title Bar Inactive Color
Function UnSetTitleBarInactiveColor {
    Write-Output "Unsetting TitleBar inactiveColor hotkey..."
    Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Accent" -Name "AccentColorMenu" -ea SilentlyContinue
    Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "AccentColor" -ea SilentlyContinue
    Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "AccentColorInactive" -ea SilentlyContinue
}