17 lines
849 B
AutoHotkey
17 lines
849 B
AutoHotkey
|
#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)
|
||
|
}
|