How to toggle the auto-hide status of the Windows taskbar

10

5

I use Windows 8 on my desktop. Currently I have to move my mouse over the taskbar, right click, click on properties, click on auto-hide the taskbar, and then click OK. This is a real pain if you want to toggle this status between on and off several times during the day. In fact, it's unworkable, so it stays on by default and wastes a lot of screen real estate when I don't need it.

Is there a better way?

(If it helps, I use Autohotkey.)

Kit Johnson

Posted 2013-10-04T01:57:44.603

Reputation: 886

See this post

– Portland Runner – 2013-10-04T03:05:06.510

@PortlandRunner Thanks for the tip. I'd already seen it, but it's trying to do something different, which is to show a hidden taskbar. I want to toggle the auto-hide status of the taskbar, from 'do auto-hide' to 'do not auto-hide', and back again. – Kit Johnson – 2013-10-07T03:30:32.807

Answers

15

Here is an AutoHotKey script to resolve the problem:

VarSetCapacity(APPBARDATA, A_PtrSize=4 ? 36:48)

Space::
   NumPut(DllCall("Shell32\SHAppBarMessage", "UInt", 4 ; ABM_GETSTATE
                                           , "Ptr", &APPBARDATA
                                           , "Int")
 ? 2:1, APPBARDATA, A_PtrSize=4 ? 32:40) ; 2 - ABS_ALWAYSONTOP, 1 - ABS_AUTOHIDE
 , DllCall("Shell32\SHAppBarMessage", "UInt", 10 ; ABM_SETSTATE
                                    , "Ptr", &APPBARDATA)
   KeyWait, % A_ThisHotkey
   Return

Grey

Posted 2013-10-04T01:57:44.603

Reputation: 441

1Found this via google. Doesn't seem to work on Windows 10: It always switches to "always show", but the other direction (to "auto hide") doesn't work. – srs – 2018-04-01T11:06:41.280

If you just want to toggle taskbar visibility, remove the "Space::" line for the keyboard shortcut. Then compile the script. Every time it runs, it will change the visibility of the taskbar (hide it if currently show, and vice versa). Works perfectly when added to a scheduled task in Windows 10. Now if you set your taskbar to auto hide and run this script at login (or with a delay at login), your taskbar will never be visible until you mouse over it. Solved a pseudo-kiosk mode I'm running on a standalone system. – John Suit – 2018-04-23T18:16:35.003

1Works perfect in Windows 10. Just remember to add the VarSetCapacity(APPBARDATA, A_PtrSize=4 ? 36:48) line at the top of your script (before your hotkeys). – Shayan – 2019-01-13T19:51:32.260

Thanks very much for posting that. Does this just hide the taskbar and leave other windows as they are, or will they automatically fill the space that the taskbar used to occupy? The problem with many solutions is that the taskbar hides but other windows don't fill the space. – Kit Johnson – 2013-10-09T06:14:33.417

1This works for me (w7 x64). All windows are fill the space that the taskbar used. – Grey – 2013-10-12T18:56:51.837

Wow - this is the perfect solution for me, since I already use AutoHotKey. Thanks so much - working on Windows 8.1. – Kit Johnson – 2013-10-14T03:47:19.353

3Note that this script is using Space as a hot key (if you were wondering how to toggle hide/show) which is not ideal. I replaced it with #b (win + b, b for bar). – alexeit – 2014-02-05T04:09:46.137

For some reason if you press the hot key repeatedly with a small delay it will skip every second call eg hit hot key -> it will toggle -> hit again -> nothing happens -> hit again -> it will toggle and so on. However it works fine if delay between hot key presses is more then a few seconds. – alexeit – 2014-02-05T04:14:44.557

3

Try this little program that I found a while ago. 'Tis amazing. It toggles the taskbar shown or hidden with Alt-T, and you can set it to start up with windows as well.

http://www.aviassin.com/taskbareliminator

It's called Taskbar Eliminator and it works for both Win7 and Win 8

Ethan Brouwer

Posted 2013-10-04T01:57:44.603

Reputation: 161

Yes, that's the perfect little app. Just what I was looking for! – Kit Johnson – 2013-10-14T03:39:08.523

I'm forced to accept the other answer that uses AutoHotKey, though, since it doesn't require installing any more software than I already use. I'm sure your answer will be the right one for someone else, though. – Kit Johnson – 2013-10-14T03:48:44.483

3

I found a program called "Taskbar Control" thats lets you set a Taskbar Autohide toggle key.

Taskbar Control

http://www.thefreewindows.com/3252/hide-completely-the-windows-taskbar-using-a-hotkey-and-unhide-it-with-taskbar-control/

Note: Make sure you download "Taskbar AutoHide Control" version if you want your current window to auto-fill the space.

user312348

Posted 2013-10-04T01:57:44.603

Reputation: 39

there's no download link on the page. I guess it's removed? – Shayan – 2019-01-12T16:26:42.697

2

To autohide the taskbar from a cmd prompt or in a .cmd or. bat file:

Windows 7 (StuckRects2)

powershell -command "&{$p='HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2';$v=(Get-ItemProperty -Path $p).Settings;$v[8]=3;&Set-ItemProperty -Path $p -Name Settings -Value $v;&Stop-Process -f -ProcessName explorer}"

Windows 10 (StuckRects3)

powershell -command "&{$p='HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3';$v=(Get-ItemProperty -Path $p).Settings;$v[8]=3;&Set-ItemProperty -Path $p -Name Settings -Value $v;&Stop-Process -f -ProcessName explorer}"

Explanation

The registry key which stores this value also stores a number of other settings. Since we only want to change position 9 ($v[8] in the cmd) of that registry setting, we need to preserve the other settings.

Normally from cmd, it's enough to use a reg add command to modify the registry, but we use powershell because it makes it easy to preserve the other settings stored under the same registry key.

Explorer also needs to be restarted to pick up the change. We use Stop-Process because Windows automatically restarts Explorer when it is stopped.

Note: change $v[8]=3 to $v[8]=2 in the commands above to undo this change (if you want the taskbar to be always visible).

grenade

Posted 2013-10-04T01:57:44.603

Reputation: 457

I like your reply. Even if the other tools might be better/easier your explanation was the most interesting. – Don King – 2019-01-04T09:02:42.787

1

"taskbar real toggle"

The AutoHotKey script above in the best answer works fine. On my PC I combined it with

http://www.itsamples.com/taskbar-hider.html

(v1.2)

This taskbar hiding application lets me choose the hotkey to hide the taskbar. I mapped the AutoHotKey-hotkey to Win+A and the TaskBar Hider to Win+Y. So now when I press Win+Y, Win+A the taskbar toggles without popping up again when I accidentally the bottom pixel; when I press Win+Y, Win+A again it comes back and stays there no matter where I put the mouse cursor and it's just great. A one-key solution would be even better though with the two hotkeys so close together it's really manageable.

Maybe there is a better (one-key-) solution using just AutoHotKey?

mbbmbbmm

Posted 2013-10-04T01:57:44.603

Reputation: 19

1does not work with my win7 64bit. – Edwin Yip – 2015-07-04T07:33:17.543

Of course you could edit the AHK script to also emit the second keypress event. – Aaron Thoma – 2015-11-12T15:10:46.137

1Does not work on Windows 10 – Shayan – 2019-01-12T14:35:42.170

1

I couldn't get the AutoHotKey script from Gray to work for me on Win 8.1, so I made one. Put this in a .ahk file

Windows 8.1 version:

Run, %SystemRoot%\System32\rundll32.exe shell32.dll`,Options_RunDLL 1
WinWait, Taskbar and Navigation properties, 
IfWinNotActive, Taskbar and Navigation properties, , WinActivate, Taskbar and Navigation properties, 
WinWaitActive, Taskbar and Navigation properties, 
Send, {ALTDOWN}u{ALTUP}{ALTDOWN}a{ALTUP}{ESC}
Exit

Windows 10 version (tested on version 10.0.17134.523 1/13/2019):

#NoEnv
#Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.

Run ms-settings:taskbar
WinWait, Settings, 
WinWaitActive, Settings, , 3
if ErrorLevel
{
    MsgBox, WinWait timed out.
}

CoordMode, Pixel, Client 
WinGetPos, X, Y, Width, Height
;OutputDebug, Width Height %Width% %Height%

; Wait for Settings UI to load
Sleep 500

if (Width <= 735)
{
    Send {TAB}{TAB}{space}
}
else
{
    Send {TAB}{TAB}{TAB}{space}
}

;Close the settings UI
Sleep 150
Send !{F4}

Exit

(You may need to adjust the sleep durations if they are not long enough on your system. There is probably a better way to detect when the UI has loaded besides sleeping, but I couldn't figure it out. I couldn't detect the text box control in the UI. I tried to detect a color pattern but the end user has control of the color scheme.)

Chuck

Posted 2013-10-04T01:57:44.603

Reputation: 11

What does u and a do in Send, {ALTDOWN}u{ALTUP}{ALTDOWN}a{ALTUP}{ESC} I can't find anything in the docs. – Shayan – 2019-01-12T15:01:04.603

It does not work for me on Windows 10 – Shayan – 2019-01-12T16:00:05.027

1U and A are the keystrokes sent to the application, specifically alt-U and alt-A. I’ll check on Win10 later. – Chuck – 2019-01-13T19:16:06.580

0

Yes you can download this great tool called " Hide Taskbar" , which gives you a shortcut " Ctrl+Esc" (by default, you can change it) to hide/unhide the taskbar

download here

http://www.thewindowsclub.com/hide-taskbar-windows-7-hotkey

Fahad Saleem

Posted 2013-10-04T01:57:44.603

Reputation: 662

This tool is created with autohotkey and all it does is, it sets the transparency of Shell_TrayWnd to 0 (hides it) – Shayan – 2019-01-12T14:33:00.663

1Thank you for this answer. I downloaded the program. Unfortunately when I press "Ctrl+Esc" it hides the taskbar, but it just leaves an empty task-bar-sized space on the desktop. Maximised applications don't use up that space (which is now wasted space). When I use the built-in Windows option, applications automatically will maximise to fill the entire screen. Now I just have a black strip where the taskbar used to be, but I don't get any more screen real estate. – Kit Johnson – 2013-10-07T03:33:54.760