I've found a workaround for my issue, which is similar -- the taskbar randomly unhides, and won't re-hide, and/or doesn't autohide after a reboot -- so I thought I'd share what I've found in case it helps anyone else. My symptoms when it won't autohide are that the Settings still has Autohide checked; but unchecking and re-checking has no effect. I have three monitors, and it's the same behavior on all.
I have noticed that one way to definitely cause it to unhide-and-never-rehide is when a (firefox) browser window pops up an alert about logging me out of some web site in like 60 seconds if I don't click to continue -- were said alert causes the taskbar to unhide -- AND if I don't notice that alert and dismiss it, after some number of minutes the unhide becomes permanent; even if I come back a while later and dismiss the browser alert. Closing the window with the alert will also lead to not re-hiding, as will killing/restarting firefox. The Settings is still set to autohide, but it's as if some flag in the windows OS/explorer or firefox code to re-hide never gets reset, or times out. So: that's one way to cause the behavior; maybe someone at MSFT or Mozilla can find&fix that bug.
My workaround when the taskbar gets stuck unhidden is first to restart the main Windows Explorer task, as others have noted (either manually via Task Manager [find the task & right click Restart], or via a script [see below]). However, this apparently now won't show the clock and other icons in the taskbar's right hand side when it pops up -- it's just blank -- so my second step is to go to Settings and turn autohide off then on again.
It happens to me a lot and I hate doing things manually, so being a computer science professor sort, I wrote a bat+cygwin script + C app to do it for me; I just have to click my app and poof! back in business.
For those who might want the same (and are comfortable with using/installing Cygwin and gcc -- this won't work without those), here's the code, followed by some explanation of what's going on:
========================= rehide.bat ================
@echo off
rem kill the main explorer task
for /f "tokens=2,10" %%p in ('tasklist /nh /v /fi "imagename eq explorer.exe"') do if "%%q"=="N/A" taskkill /f /pid %%p
rem give it a second to be really gone
sleep 1
rem restart explorer.exe -- however, just calling explorer.exe here sometimes starts an explorer folder window, not the main app/taskbar, so I'm using cygwin's "run" command to start the real thing
run explorer.exe
rem now fix the taskbar so it shows the right hand side stuff, by turning autohide off then on again using my C code
sleep 1
c:\path\to\where\you\put\it\autohide.exe -
sleep 1
c:\path\to\where\you\put\it\autohide.exe +
=========================
========================= autohide.c ================
/*
* usage: autohide [ +|-|! ]
* + turn on autohide
* - turn off autohide
* ! toggle autohide (default; actually anything other than + or - will toggle)
*/
#include <windows.h>
#include <shellapi.h>
// This isn't defined for me for some reason.
#ifndef ABM_SETSTATE
#define ABM_SETSTATE 0x0000000A
#endif
#define HIDE_ON '+'
#define HIDE_OFF '-'
int main(int argc, char *argv[]) {
APPBARDATA abd = {sizeof abd};
UINT uState = (UINT) SHAppBarMessage(ABM_GETSTATE, &abd);
LPARAM on\_top\_state = uState & ABS\_ALWAYSONTOP;
LPARAM autohide\_state = uState & ABS\_AUTOHIDE;
if (argc > 1 && argv[1][0] == HIDE\_ON)
autohide\_state = ABS\_AUTOHIDE;
else if (argc > 1 && argv[1][0] == HIDE\_OFF)
autohide\_state = 0;
else
autohide\_state = ~autohide\_state & ABS\_AUTOHIDE;
abd.lParam = on\_top\_state | autohide\_state;
SHAppBarMessage(ABM\_SETSTATE, &abd);
return 0;
}
=========================
You would put the autohide.c file in some folder of your choice (i.e. c:\path\to\where\you\put\it\ in the rehide.bat script above) then run cygwin's C compiler to create the autohide.exe app that you need; e.g.
gcc autohide.c -o autohide.exe
and edit the .bat file to put in your chosen c:\path\to\where\you\put\it\ path.
The .bat script is somewhat complex since it has to restart just the main Explorer task, not close all your open folder windows. The taskbar is part of the same Explorer app that provides the folder stuff. That task has an image name of N/A from 'tasklist', so you need to loop on all explorer tasks and kill just that one. Thankfully I found this clever code on someone else's post about how to kill just the main explorer task. Likewise, I adapted the C code I found on another post about controlling autohide from C code. You also have to make use of cygwin's "run" command to start Explorer again as a main task, rather than the showing-folders behavior. (As an aside, if a manual right-click-Restart didn't work right and you're stuck without explorer running at all, you can restart explorer manually via ctrl-alt-del, task manager / File / Run new task, "Explorer". Helpful tip.) :)
So -- hopefully someone in MSFT can figure out why the autohide stops hiding and fix it; and maybe this solution will help someone else in the meantime.
Cheers!