This Autohotkey script is intended to dim the taskbar when it is not needed in order to reduce the burn-in effect on OLED displays.
This script originally came from: https://superuser.com/a/1691664
Original script from the link above:
SysGet, Monitor, Monitor ; Get monitor dimensions
SysGet, WorkArea, MonitorWorkArea ; Get monitor work-area without taskbar
dimtop := % WorkAreaBottom + 1 ; taskbar is assumed to start below the work-area
Gui Color, 0,0 ; Black color
Gui -Caption +ToolWindow +E0x20 ; No title bar, No taskbar button, Transparent for clicks
Gui Show, X0 Y%dimtop% W%MonitorRight% H63 ; Create a semi-transparent cover window
WinGet ID, ID, A ; Get its HWND/handle ID
Winset AlwaysOnTop,ON,ahk_id %ID% ; Keep it always on the top
WinSet Transparent,99,ahk_id %ID% ; Transparency 99/256
SetTimer, coverIt, 500 ; Repeat setting it to be on top of the taskbar
return
coverIt:
WinGet style, Style, A ; Get active window style and dimensions
WinGetPos ,,,winW,winH, A
; 0x800000 is WS_BORDER.
; 0x20000000 is WS_MINIMIZE.
; check no border and not minimized
isfull := ((style & 0x20800000) = 0 and winH >= A_ScreenHeight and winW >= A_ScreenWidth)
if (isfull) {
WinHide, ahk_id %ID%
} else {
WinShow, ahk_id %ID%
Winset AlwaysOnTop,ON,ahk_id %ID% ; Ensure it is still on the top
}
return
Save the script in a file called taskbardimmer.ahk
and place it in C:\Users\USER-NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
so it will start automatically upon login.
I have created a modified version of the script which:
- Increases the darkening effect by changing the transparency from the default
- Suppresses the darkening effect if "explorer.exe" owns the active window. Without this modification, there is a compatibility issue with Windows 11 and ExplorerPatcher where the taskbar is dimmed while you are actively using it.
SysGet, Monitor, Monitor ; Get monitor dimensions
SysGet, WorkArea, MonitorWorkArea ; Get monitor work-area without taskbar
dimtop := % WorkAreaBottom ; taskbar is assumed to start below the work-area
Gui Color, 0,0 ; Black color
Gui -Caption +ToolWindow +E0x20 ; No title bar, No taskbar button, Transparent for clicks
Gui Show, X0 Y%dimtop% W%MonitorRight% H63 ; Create a semi-transparent cover window
WinGet ID, ID, A ; Get its HWND/handle ID
Winset AlwaysOnTop,ON,ahk_id %ID% ; Keep it always on the top
WinSet Transparent,179,ahk_id %ID% ; Transparency 99/256
SetTimer, coverIt, 500 ; Repeat setting it to be on top of the taskbar
return
coverIt:
WinGet style, Style, A ; Get active window style and dimensions
WinGet pName, ProcessName, A ; Get active window process name
WinGetPos ,,,winW,winH, A
; 0x800000 is WS_BORDER.
; 0x20000000 is WS_MINIMIZE.
; check no border and not minimized
isfull := (((style & 0x20800000) = 0 and winH >= A_ScreenHeight and winW >= A_ScreenWidth) or pName == "explorer.exe")
if (isfull) {
WinHide, ahk_id %ID%
} else {
WinShow, ahk_id %ID%
Winset AlwaysOnTop,ON,ahk_id %ID% ; Ensure it is still on the top
}
return