Last active
November 18, 2024 07:38
-
-
Save orazdow/8d6cac9b03115edee041435b8c46c8ec to your computer and use it in GitHub Desktop.
ahk v2 nighlight, wintop, hidebar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;tray icon tooltip | |
A_IconTip := "alt-l: nightlight`nalt-q: alt-f4`nctl-alt-up: winontop`nctl-alt-b: hidebar" | |
;*********** Alt-l : open night light *********************; | |
!l:: Run "ms-settings:nightlight" | |
;*********** Alt-q : alt-f4 *********************; | |
!q::Send "!{F4}" | |
;*********** Ctl-Alt-Up : pin window on top ***************; | |
^!Up:: WinSetAlwaysOnTop -1, "A" | |
;*********** Ctl-Alt-b : hide/show taskbar ****************; | |
^!b:: { | |
static hide := 0 | |
HideShowTaskbar(hide := !hide) | |
} | |
HideShowTaskbar(action) { | |
static ABM_SETSTATE := 0xA, ABS_AUTOHIDE := 0x1, ABS_ALWAYSONTOP := 0x2 | |
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", action ? ABS_AUTOHIDE : ABS_ALWAYSONTOP, APPBARDATA, size - A_PtrSize) | |
DllCall("Shell32\SHAppBarMessage", "UInt", ABM_SETSTATE, "Ptr", APPBARDATA) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;tray icon tooltip | |
A_IconTip := "alt-l: nightlight`nctl-alt-up: winontop`nctl-alt-b: hidebar" | |
;*********** Alt-l : open night light *********************; | |
!l:: Run "ms-settings:nightlight" | |
;*********** Ctl-Alt-Up : pin window on top ***************; | |
^!Up:: WinSetAlwaysOnTop -1, "A" | |
;*********** Ctl-Alt-b : hide/show taskbar ****************; | |
^!b:: { | |
static hide := 0 | |
HideShowTaskbar(hide := !hide) | |
} | |
HideShowTaskbar(action) { | |
static ABM_SETSTATE := 0xA, ABS_AUTOHIDE := 0x1, ABS_ALWAYSONTOP := 0x2 | |
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", action ? 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