Closed aaronedev closed 1 month ago
in case anyone wonders this is my current script that works sometimes when switching workspaces but not all of the time...
global taskbarState := 0 ; save the state of the taskbar (0 = visible, 1 = hidden)
global taskbar
ToggleTaskbarVisibility()
{
WinGet, taskbar, ID, ahk_class Shell_TrayWnd ; Taskleisten-ID holen.
if (taskbarState = 0)
{
WinHide, ahk_id %taskbar%
taskbarState := 1
}
else
{
WinShow, ahk_id %taskbar%
taskbarState := 0
}
}
; Set keyboard shortcut Win + T to execute the function.
#t::
ToggleTaskbarVisibility()
return
; Handle WM_SETTINGCHANGE message to prevent taskbar from hiding when switching workspaces.
OnMessage(0x1A, "HandleSettingChange")
HandleSettingChange(wParam, lParam)
{
; Check if the wParam is equal to SPI_SETWORKAREA (0x002F) to detect workspace change.
if (wParam = 0x002F)
{
; Only restore taskbar visibility when workspace changes if it was hidden.
if (taskbarState = 1)
{
ToggleTaskbarVisibility()
}
}
}
Im using nircmd to hide my taskbar and a .bat with nircmd.exe win trans class Shell_TrayWnd 256
to hide it and nircmd.exe win trans class Shell_TrayWnd 255
to show it
@zvbt thanks for letting me know trying that out now!
Has anyone encountered and resolved this issue, or does anyone have suggestions on how to ensure the windows taskbar remains hidden 🥴 when switching workspace focus using AutoHotkey or a different solution/tool?
Thank you!