Can you change window colors?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
r2997790
Posts: 71
Joined: 02 Feb 2017, 02:46

Can you change window colors?

Post by r2997790 » 10 Aug 2022, 02:44

Hi everyone,

I know it's possible to change folder icons colors. It's also possible to universally change Windows Folder colors too I've discovered (https://www.howtogeek.com/222831/how-to-get-colored-window-title-bars-on-windows-10-instead-of-white/)

But it is possible to selectively programatically change window colours?

Eg. the download folder window has a red title bar, the program files window has a green title bar etc.

What I've looking for is a way to do a strong visual control ... ideally via color to quickly differentiate one folder from another.

Does anyone have any ideas how how I might do that?

Many thanks!
R

Rohwedder
Posts: 7551
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Can you change window colors?

Post by Rohwedder » 10 Aug 2022, 03:40

Hallo,
this covers the title bars of all existing Notepad windows with colored title guis:

Code: Select all

q::
WinGet, List, List, ahk_class Notepad
While, ID := WinExist("ClassicTitleBar ahk_class AutoHotkeyGUI")
    WinClose, ahk_id %ID% ;delete all ClassicTitleBars
Loop, %List%
{
    ID := List%A_Index%
    WinGetTitle, TGui, ahk_id %ID%
    TGui := " " Tgui ;looks better
    WinGetPos, xmin, ymin, Width, Height, ahk_id %ID%
    xGui := xmin + 40, WGui := Width - 220 ;Distances left and right
    yGui := ymin + 4, HGui := 36
    Gui,New , -DPIScale -Caption +AlwaysOnTop +ToolWindow +HwndGui
    Gui,Color, Blue
    Gui,Font, s8.5 w551 cWhite, Tahoma
    Gui,Add, Text, BackgroundTrans x0 y8 vGuiT, %TGui%
    Gui,Show, NoActivate x%xGui% y%yGui% w%WGui% h%HGui%, ClassicTitleBar
    WinSet, Transparent, 255, ahk_id %Gui%
    WinSet, ExStyle, ^0x20, ahk_id %Gui% ;0x20 = WS_EX_CLICKTHROUGH
}
Return
You could run a Timer which checks all windows (including for size and position changes) and adds different colored title bars as you wish. A lot of work!
This is what the title bar of my active notepad window looks like:
Notepad.png
Notepad.png (45.94 KiB) Viewed 482 times

Post Reply

Return to “Ask for Help (v1)”