Skip to content

Instantly share code, notes, and snippets.

@peheje
Created December 26, 2023 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peheje/4729ff26c702e20a54ee836df75e8350 to your computer and use it in GitHub Desktop.
Save peheje/4729ff26c702e20a54ee836df75e8350 to your computer and use it in GitHub Desktop.
Windows 11 toggle auto hide start menu
#!D::HideShowTaskbar()
HideShowTaskbar() {
static ABM_SETSTATE := 0xA, ABS_AUTOHIDE := 0x1, ABS_ALWAYSONTOP := 0x2
static hide := 0
hide := !hide
APPBARDATA := Buffer(size := 2*A_PtrSize + 2*4 + 16 + A_PtrSize, 0)
NumPut("UInt", size, APPBARDATA), NumPut("Ptr", WinExist("ahk_class Shell_TrayWnd"), APPBARDATA, A_PtrSize)
NumPut("UInt", hide ? ABS_AUTOHIDE : ABS_ALWAYSONTOP, APPBARDATA, size - A_PtrSize)
DllCall("Shell32\SHAppBarMessage", "UInt", ABM_SETSTATE, "Ptr", APPBARDATA)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment