congdantoancau

Toggle autohide taskbar

Feb 13th, 2019
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Open Taskbar properties, toggle autohide taskbar, apply and close window
  2. ; https://www.reddit.com/r/AutoHotkey/comments/2kcd5d/hotkey_to_toggle_autohide_the_taskbar/
  3. ;------------------------------------------------------------------------
  4. #!t::
  5.  
  6.     Run, RunDLL32.EXE shell32.dll`,Options_RunDLL 1
  7.     WinWait, Taskbar and Start Menu Properties
  8.     Send, ua{ESC}
  9.    
  10. return
  11.  
  12. ; https://superuser.com/questions/654170/how-to-toggle-the-auto-hide-status-of-the-windows-taskbar
  13. #!Space::
  14.     VarSetCapacity(APPBARDATA, A_PtrSize=4 ? 36:48)
  15.    NumPut(DllCall("Shell32\SHAppBarMessage", "UInt", 4 ; ABM_GETSTATE
  16.                                            , "Ptr", &APPBARDATA
  17.                                            , "Int")
  18.  ? 2:1, APPBARDATA, A_PtrSize=4 ? 32:40) ; 2 - ABS_ALWAYSONTOP, 1 - ABS_AUTOHIDE
  19.  , DllCall("Shell32\SHAppBarMessage", "UInt", 10 ; ABM_SETSTATE
  20.                                     , "Ptr", &APPBARDATA)
  21.    KeyWait, % A_ThisHotkey
  22. Return
Add Comment
Please, Sign In to add comment