From aeb28d6843e24db03b1ad4d3c999e09281cbba9e Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 18 Nov 2021 16:58:03 -0800 Subject: [PATCH] Add hidetaskbar.ahk. --- hidetaskbar.ahk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 hidetaskbar.ahk diff --git a/hidetaskbar.ahk b/hidetaskbar.ahk new file mode 100644 index 0000000..68f68fe --- /dev/null +++ b/hidetaskbar.ahk @@ -0,0 +1,16 @@ +#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. +SendMode Input ; Recommended for new scripts due to its superior speed and reliability. +SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. + +;Thank you teadrinker +;https://www.autohotkey.com/boards/viewtopic.php?p=257256&sid=cb7c2c01210e1d1767f562f6281625cf#p257256 + +^Esc:: HideShowTaskbar(hide := !hide) + +HideShowTaskbar(action) { + static ABM_SETSTATE := 0xA, ABS_AUTOHIDE := 0x1, ABS_ALWAYSONTOP := 0x2 + VarSetCapacity(APPBARDATA, size := 2*A_PtrSize + 2*4 + 16 + A_PtrSize, 0) + NumPut(size, APPBARDATA), NumPut(WinExist("ahk_class Shell_TrayWnd"), APPBARDATA, A_PtrSize) + NumPut(action ? ABS_AUTOHIDE : ABS_ALWAYSONTOP, APPBARDATA, size - A_PtrSize) + DllCall("Shell32\SHAppBarMessage", UInt, ABM_SETSTATE, Ptr, &APPBARDATA) +}